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

remove dynamic import statements #9937

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

raphaelschwinger
Copy link
Contributor

Summary

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.

Examples
Lines linke this cause problems because the path will not be resolved by eslint etc.

const Connection = require(driver + '/connection');

Fixes: #9603

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.
@raphaelschwinger
Copy link
Contributor Author

Thank you @hugdru for your code suggestions!

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we can't merge this into master because it would be a backwards breaking change. I can rebase this change to be against the 6.0 branch, we're planning on removing this flag with #9604 anyway.

@vkarpov15 vkarpov15 changed the base branch from master to 6.0 February 17, 2021 01:05
@vkarpov15 vkarpov15 merged commit a968f70 into Automattic:6.0 Feb 17, 2021
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.

Cannot find module './drivers/node-mongodb-native/connection' using Parcel
2 participants