itaylor / redux-socket.io

An opinionated connector between socket.io and redux
410 stars 53 forks source link

How use it with react-hot-loader? #29

Closed romanlex closed 7 years ago

romanlex commented 7 years ago

I cannot use this component with webpack-dev-server and react-hot-loader((( Why I get this error and how I can build properly my app?

I use babel and webpack2. My components:

"redux-socket.io": "^1.4.0", "socket.io": "^2.0.1",

My errors:

ERROR in ./~/socket.io-client/~/debug/browser.js Module build failed: Error: ENOENT: no such file or directory, open '/mnt/develop/www/domains/frontend.webqual.lo/node_modules/socket.io-client/node_modules/debug/browser.js' @ ./~/socket.io-client/lib/index.js 9:12-28 @ ./app/store.js @ ./app/index.js @ multi react-hot-loader/patch webpack-dev-server/client?http://localhost:3000 webpack/hot/only-dev-server vendor.js index.js

ERROR in ./~/engine.io-client/~/debug/browser.js Module build failed: Error: ENOENT: no such file or directory, open '/mnt/develop/www/domains/frontend.webqual.lo/node_modules/engine.io-client/node_modules/debug/browser.js' @ ./~/engine.io-client/lib/socket.js 7:12-28 @ ./~/engine.io-client/lib/index.js @ ./~/engine.io-client/index.js @ ./~/socket.io-client/lib/manager.js @ ./~/socket.io-client/lib/index.js @ ./app/store.js @ ./app/index.js @ multi react-hot-loader/patch webpack-dev-server/client?http://localhost:3000 webpack/hot/only-dev-server vendor.js index.js

itaylor commented 7 years ago

I've used this project with both webpack-dev-server and react-hot-loader, and it works fine. None of the above errors reference this project, redux-socket.io.

If I had to guess, it looks to me like you don't have socket.io and/or socket.io-client properly installed.