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
Server.prototype.serveClient does not work with webpack #3017
Comments
same issue |
Try disabling socket.io's serving client files feat.
Not ideal, but at least the bundle works. |
I think this is the same error, I get on runtime by using webpack
I don't use if I use
|
Thanks this worked for me. |
For future readers: please check https://socket.io/docs/v4/server-with-bundlers/ |
Current behaviour
The function uses relative path to check for socket.io-client. However, if I use webpack to bundle a nodejs application that uses webpack. This will become the relative path to socket.io-client in node_modules.
Running node will then return an error:
Error: Cannot find module "."
Steps to reproduce (if the current behaviour is a bug)
Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.
The compiled code in the bundle becomes:
Expected behaviour
The package should compile with webpack just fine and run smoothly.
Setup
"webpack": "^3.3.0"
"socket.io": "^2.0.3",
"socket.io-client": "^2.0.3"
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered: