Do not add trailing slash to websocket path#28
Conversation
There was a problem hiding this comment.
I don't think this is necessarily a CRA exclusive fix, as what we're actually doing is exactly following the configuration provided by the user. This matches the handling of path below when creating the HTTP reverse proxy. Hopefully this isn't too controversial.
Looking at usage of dev-nginx setup-app across the organisation, I can't see any service that this change will negatively impact. In some cases, it'll actually make them easier to run!
|
I suspect the trailing Footnotes
|
Good find - so Michael figured this out ages ago! 😂 Shame he wasn't still on the team when I started digging into this |
When using Hot Module Reloading (HMR) with Create React App (i.e. WebPack under the hood), the WebSockets server is listening at
/sockjs-nodefor CRA/WebPack v4:and at
/wsfor v5:Since dev-nginx adds a trailing slash to the nginx config, it fails to proxy these through correctly:
Removing the trailing slash fixes the issue: