Webpak - Critical dependency: the request of a dependency is an expression
See original GitHub issueHi! I want to bundle postcss-cssnext
package with Webpack for a web app and browserslist
is also included. I’m following the information mentioned in README.md to remove locales (new webpack.IgnorePlugin(/caniuse-lite\/data\/regions/)
) but have a doubt on something else.
There’s a scary warning when bundling with Webpack: Critical dependency: the request of a dependency is an expression
on this line. According to Webpack docs, full dynamic requires fail by default.
They mention that ContextReplacementPlugin can be used in this situation but I don’t really know what is the actual context and where to redirect it. Any idea on how to fix this?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Webpack - Critical dependency: the request of a dependency ...
Webpack - Critical dependency: the request of a dependency is an expression · Manually configure webpack to import the required libraries and ...
Read more >Webpack Warning: Critical dependency: the request of a ...
When looking at webpack/webpack#196 this seems to be a webpack warning about a require statement using a dynamic path for loading, as this...
Read more >the request of a dependency is an expression webpack - You ...
When a library uses variables or expressions in a require call (such as require ('' + 'nodent') in these lines of ajv ),...
Read more >Webpack - the request of a dependency is an expression
Webpack – Critical dependency: the request of a dependency is an expression · Manually configure webpack to import the required libraries and prevent...
Read more >Integration with WebPack - Linkurious documentation
Critical dependency: the request of a dependency is an expression. This warning is due to a line in Ogma that attempts to require...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ai Thanks for answering! Looks like
resolve.dynamic: false
is not a valid option at least inwebpack@3.10.0
. The following suppresses the warning but I’m not sure if it’s reliable:According to the docs, these props are deprecated and
ContextReplacementPlugin
should be used instead. However, I couldn’t stop the warning with that plugin… 😕Released in 2.11.2