-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Cannot find module './drivers/node-mongodb-native/connection' #4031
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
Did you find a solution @SilverCoder ? |
Hello, I've ran into this issue while trying to compile and bundle a node app into a single .js file with parcel 2. My current environment:
My parcel target is setup like this:
The project also has a .babelrc wich looks like this:
Is this a parcel issue, or should i open one over at mongoose? |
Can you please provide a code sample to reproduce that error with the configuration you posted? Is simply importing mongoose enough to trigger this? |
Just simply importing mongoose will trigger this. The source files
|
The same issue happened with esbuild, and this is due to mongoose using require with a variable and not a string. It doesn't bundle the files that are required without a string. |
Exactly! @mischnic |
I see. Thanks a lot, both of you. _Edit: I'm still thinking about the require of "global.MONGOOSE_DRIVER_PATH". I guess this problem could be approached the way webpack does it by bundeling the entire directory. It's not ideal or optimal, but seems like a good option. What are the chances of something like this making it into parcel?_ |
We agree with esbuild's position here: evanw/esbuild#480 (comment)
Somewhat related Parcel issue: #125
I'm afraid not. One hack would be using |
I completely understand your standpoint, and agree with it as well. I'm going to continue this over at mongoose. Thanks for all the help. |
Importing from paths generated at runtime breaks parcel, see (parcel-bundler/parcel#4031), or esbuild, see (evanw/esbuild#480) By removing the calls to the deprecated global MONGOOSE_DRIVER_PATH this issue can be resolved.
Importing from paths generated at runtime breaks parcel, see (parcel-bundler/parcel#4031), or esbuild, see (evanw/esbuild#480) By removing the calls to the deprecated global MONGOOSE_DRIVER_PATH this issue can be resolved.
this a 🐛 bug report
hi,
i'm trying to bundle a nodejs app (using mongoose) with parceljs.
the bundle succeeds but when i try to run the bundled file, i get the follwing error.
Cannot find module './drivers/node-mongodb-native/connection'
🎛 Configuration (.babelrc, package.json, cli command)
.babelrc
tsconfig.json
package.json
🤔 Expected Behavior
i expect to execute npm run bundle and get an index.js that works :)
😯 Current Behavior
🌍 Your Environment
The text was updated successfully, but these errors were encountered: