-
Notifications
You must be signed in to change notification settings - Fork 134
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: require function is used in a way in which dependencies cannot be statically extracted #187
Comments
It's most likely the way babel-plugin-macros loads cosmiconfig... |
babel-plugin-macros/src/index.js Lines 26 to 27 in 8fc6383
|
Ah ok. So the warning is probably safe to ignore then right? Nothing is actually being required by this code, and the places that do call into this code probably all look like perfectly normal |
Looks like ignoring this warning won't cause any issues for now. Not sure though. |
I'm pretty sure that ignoring it won't cause issues. The warning clearly seems to be about the ability to extract the dependency graph, which is not affected. It does seem suspicious to me though that webpack would be parsing |
Is there a way to prevent linting packages from being parsed while bundling through webpack!! |
I don't know, because I don't know why it is parsing them. |
Any news ? |
No news, unless webpack offers some kind of special comment that silences that warning? |
I have been setting up swc with webpack. There is a package I use for linting -- eslint-config-react-app. This has a dependency on babel-plugin-macros. I get the following warning on starting the dev server.
Webpack version is 5.75
WARNING in ./node_modules/babel-plugin-macros/dist/index.js 75:22-29 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
Looks like it is caused due to the way require is being used in this plugin. Not sure how to get rid of this warning.
babel-plugin-macros
version: 3.1.0node
version: 18.12.1npm
version: 8.19.2I removed all dependencies of babel and it's related packages to avoid any potential conflicts between swc and babel but the warning is still present.
The text was updated successfully, but these errors were encountered: