Skip to content
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

setting WDS_SOCKET_PATH does not fix what path the dev server responds on #12092

Open
iamfrisbee opened this issue Feb 24, 2022 · 4 comments
Open

Comments

@iamfrisbee
Copy link

If you run a simple npx create-react-app my-app and then try to start it with WDS_SOCKET_PATH=/somethingelse npm start the fast refresh won't actually work. In fact, the WS never responds. The solution that worked to fix this was:

  1. First eject the app: npm run eject
  2. Then edit the file /config/webpackDevServer.config.js and add webSocketServer: { options: { path: sockPath } }, to the configuration.
@jacobweberbowery
Copy link

Ran into this too — thanks for the workaround!

@doconix
Copy link

doconix commented Mar 21, 2022

Also hit this bug when going through a proxy.
We haven't ejected but instead are using react-app-rewired to modify CRA's config.

We have WDS_SOCKET_PATH set in the environment, then in config-overrides.js, devServer section:

config.webSocketServer = config.webSocketServer || {}
config.webSocketServer.options = {
    ...config.webSocketServer.options,
    path: process.env.WDS_SOCKET_PATH,
}

[edit: to be clear, the above fix made hot-reloading work again]

@vasilev-alex
Copy link

I'm having the same issue. @iamfrisbee's solution worked for me

@tiredenzo
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants