-
Notifications
You must be signed in to change notification settings - Fork 66
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
Critical dependency: the request of a dependency is an expression #88
Comments
I also have this problem. |
Me too. Downgrading fixes this. |
Same here, should be downgraded to 2.3.0 |
keep an eye on this bug: airbnb/babel-plugin-dynamic-import-node#88
The created output here is something like this: Promise.resolve('prefix-${var}').then(s => require(s)) If this is check by webpack, it results in unmatched dynamic imports. The fix for #84 need to be reverted and fixed in another way. |
cc @nicolo-ribaudo we may have to revert to the original, but still evaluate the result twice so as to evaluate it sync? |
@wmm387 @KnisterPeter this plugin is for node, not for webpack - we have https://github.com/airbnb/babel-plugin-dynamic-import-webpack for webpack 1 and 2, and webpack 3+ understands this syntax natively. |
@ljharb Thanks for the hint |
Evaluating twice is worse than evaluating asynchronously. Also, it would bring back the bug that originally led to that PR ( If the dynamic import argument is a single Promise.resolve().then(s => require("./module")) in more complex cases where it would be observable, I think that it is better to do the correct thing rather than trying to adapt the output to webpack, which doesn't need this plugin in the first place. |
That seems totally reasonable. |
in vue-router
error: Critical dependency: the request of a dependency is an expression;
webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:17 [vue-router] Failed to resolve async component default: Error: Cannot find module '@/views/home/index'
Rolling back and locking into 2.3.0 resolves the issue.
The text was updated successfully, but these errors were encountered: