Closed giovanni-bertoncelli closed 10 months ago
Hi @giovanni-bertoncelli , could you please provide a project reproducing the issue? That would help a lot, thanks.
@darrachequesne https://codesandbox.io/s/serene-thunder-edirx3?file=/tsconfig.json here you can find a similar behaviour
@giovanni-bertoncelli thanks, I could indeed reproduce. I'm investigating.
It may be similar to this issue @darrachequesne: https://github.com/socketio/socket.io-client/issues/1088 Maybe it's actually the same behaviour
I'm not able to reproduce with a project created with @ng/cli
: https://github.com/socketio/socket.io-fiddle/tree/angular-sio-v2
Could it be linked to the CodeSandbox platform?
Don't think so... the issue compared initially in a local project.. maybe try with a ng14 project locally on your machine
Describe the bug Since I have upgraded an Angular 13 app to Angular 14, that underneath uses webpack@5.74.0, the socket.io-client has a lot of issues and became unusable. All the nodejs polyfills for the
ws
dependency are gone so I got these kind of errors:I had to redirect all these dependencies to make it work:
That's very frustrating since these dependencies where not required before the ng upgrade and I have no actual use for these in my main package.json.
After resolving this issue I've encontered another issue, at runtime:
That, I presume, comes from the tls dependency:
In order to avoid all this I've installed
isomorphic-ws
and replaced thews
dependency with this package. Then it has no nodejs dependencies and compiles correctly.To Reproduce
Socket.IO server version:
2.4.1
Socket.IO client version:2.5.0
Expected behavior Should compile correctly.
Platform: