Error when building for WebPack
See original GitHub issueA while ago, I had realized that there is an error when trying to use socket.io-client
within a WebPack module. It turns out, that “dist/debug.js” can not be located. I did a little bit of unixy research:
Ingwie@Ingwies-Macbook-Pro.local ~/W/BIRD3 $ grep -r "dist/debug" node_modules/socket.io-client/
node_modules/socket.io-client//node_modules/engine.io-client/node_modules/debug/Makefile:all: dist/debug.js
node_modules/socket.io-client//node_modules/engine.io-client/node_modules/debug/Makefile:dist/debug.js: node_modules browser.js debug.js dist
Ingwie@Ingwies-Macbook-Pro.local ~/W/BIRD3 $ find node_modules/socket.io-client -name "dist"
[empty]
Ingwie@Ingwies-Macbook-Pro.local ~/W/BIRD3 $ find node_modules -name "debug.js" | grep dist
Conclusion: The dist
folder must be a virtual folder that is used during the Browserify process… Now, how exactly do I get rid of that? It’s really heavy-lifting to require("socket.io-client/socket.io")
although there already IS a system that knows commonJS.
With heavy-lifting, I mean that adding the SIO client is ~350KB… A fix would be pretty awesome.
Issue Analytics
- State:
- Created 8 years ago
- Comments:27 (2 by maintainers)
Top Results From Across the Web
Webpack build error - node.js - Stack Overflow
Strange workaround: I zipped my entire node_modules map and transfered it to PC_A and placed it correctly. Now webpack builds just fine. So...
Read more >How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >Error when building with webpack on Windows. #544 - GitHub
Webpack build fails on Windows when using the @next version and updated dependencies. Running tns build android --bundle --env.uglify results in ...
Read more >Netlify Build Deployment Error because of Webpack - Support
Site Name: MMODoctor Framework: NextJS Application Error: Webpack Build Error 8:53:35 PM: Build ready to start 8:53:37 PM: build-image version: ...
Read more >Webpack Error when building perspective module
If that all looks correct/consistent, then it seems likely to be an error in tsconfig (the ts compiler configurations) and/or the webpack module ......
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
should work fine with
webpack
+babel
@rgranger This’s an example on how to use
webpack
andsocket.io
for the server:package.json
webpack.config.js
server.js
A sample Webpack build for the server : https://github.com/socketio/socket.io/tree/master/examples/webpack-build-server