Webpack dependency warnings in 0.3.22
See original GitHub issueHey,
after upgrading to 0.3.22 I get two webpack warnings, that I’ve never seen before. I’m using create-react-app to build my React app.
Compiled with warnings.
./node_modules/peerjs/dist/peerjs.min.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
./node_modules/peerjs/dist/peerjs.min.js
Critical dependency: the request of a dependency is an expression
Unfortunately there are no line numbers in the output and I don’t know enough about the webpack process to narrow this down. Also googling leads to many different causes for these warnings. Can anyone point me in the right direction, where these warnings come from?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to Prevent Webpack Error after npm Install?
I was working on a project, and everything was going good, until I did npm install . Then, Webpack throws the following error:...
Read more >3 warnings in child compilations (use 'stats.children: true' resp ...
Solution 1: Add stats.children: true In order to solve this warning you just need to add stats.children: true in your webpack.mix.js file. First...
Read more >Stats Data - webpack
webpack is a module bundler. ... The stringified raw source "warnings": 0 // Number of warnings when resolving or processing the module }....
Read more >license-webpack-plugin | Yarn - Package Manager
No explicit configuration is necessary anymore. · There is no dependency on ejs anymore. · Packages are identified by traversing dictories upward until...
Read more >Dependencies | @backstage/cli | npm - Open Source Insights
arrow_right @babel/core. 7.20.5 Notes
Version 7.20.5 Published November 28...
arrow_right @babel/plugin‑transform‑modules‑commonjs. 7.19.6 Notes
Version 7.19.6 Published October 20, 20...
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 Free
Top 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

It is probably coming from how parcel is bundling the package and dependencies, it is probably doing something like require(package) where:
And webpack don’t like that because he cannot find which dependency is trying to be loaded.
Anyway webpack shouldn’t be analyzing node_modules. So yes, it comes from webpack, but it is probably caused by the create-react-app’s webpack configuration.
So you may fix it if you do an eject and plays with the webpack configuration.
PD: if you have time, I recommend you to try to switch to parcel, I’ve moved enormous projects with tons of webpack plugins into parcel in a matter of 2-3 days. (I know parcel very well)
I’m closing this as the issue is not in PeerJS