Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "No url defined in config file" when using ESM #454

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

drewB
Copy link

@drewB drewB commented Dec 10, 2024

I recently ran into an issue where I could now longer migrate because I was getting the error: "ERROR: No url defined in config file! Error: No url defined in config file!".

The issue is that the code for handling importing the config file when it is ESM assumes that node will throw an error when you try to require an ESM file. That error was no longer being thrown and the returned module was all nested under default. As result, it couldn't find the url.

This PR, correctly handles this case.

Checklist
  • npm test passes and has 100% coverage

@dawsayan
Copy link

@drewB Mate! You are God sent!
I was updated my node from 21 -> 22 and spent several hours trying to fix this 🐛

image

@reviews please kindly review and approve this PR, so that I can just use package instead of manually overwriting /app/node_modules/migrate-mongo/lib/env/config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants