-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Dev server crashes with react-scripts v4 #1705
Comments
Seems to be caused by the fast refresh changes in You can temporarily work around the error by setting an environment variable Something like this
|
Alternatively, just include it in your package.json:
|
Temporary Fix:
This worked for me. Auto-refresh working fine. |
Maybe this is related facebook/create-react-app#9872 ? |
I have the same problem,when upgrade to 11.1.2,and 11.1.1 has the same problem I find react-dev-utils in package.json upgrade from ^9.1.0 to ^11.0.0 react-dev-utils@9.1.0 use sockjs-client, an react-dev-utils@11.0.0 use browser WebSocket directly In Chrome network panel, the requests are different . react-styleguidist@11.1.2(react-dev-utils@11.0.0): The selected websocket request in the second picture cause the webpack dev server crash
I'm not sure this bug is cause by react-dev-utils/webpackHotDevClient(should not send the /sockjs-node websocket connection), or by webpack-dev-server(should handle the connection correctly) |
In this source code: https://github.com/webpack/webpack-dev-server/blob/89ffb86cd26425c59e3937ca06a2c804a01b8f1d/lib/utils/getSocketServerImplementation.js#L9 webpack-dev-server support two method: ws and sockjs by passing transportMode, if not given, use {server: 'sockjs', client:'sockjs'} as default Since the latest version of webpackHotDevClient use WebSocket, so I think it should be passed by // webpack.config.js
module.exports = {
devServer: {
transportMode: {
server: 'ws',
client: 'ws',
},
},
}; This worked for me. |
🎉 This issue has been resolved in version 11.1.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Current behavior
When running
styleguidist server
withreact-scripts
4.0.0 and open in the browser, the server crashes with "Error: Already listening" message.To reproduce
yarn create react-app test
yarn add -D react-styleguidist
yarn styleguidist server --open
Demo repository:
https://github.com/varoot/styleguidist-example
Expected behavior
The dev server should run without crashing. User should be able to see the styleguide.
The text was updated successfully, but these errors were encountered: