Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When using create-react-app why does the development server keep disconnecting?

People also ask

Which server does create React app use?

The development server created by WebpackDevServer will also create a listener for changes in your JavaScript file. When you make changes and save your JavaScript file, the development server will recompile your code and quickly refresh the browser.

Why not to use create React app in production?

However, it is not created for production. Unfortunately, devs have been using it for all their projects. CRA limits your ability to change any configurations, it has tons of unneeded dependencies, you can't customize configurations, you can't build microfrontends …

Does create React app have a server?

By default, Create React App produces a build assuming your app is hosted at the server root. This will let Create React App correctly infer the root path to use in the generated HTML file. Note: If you are using react-router@^4 , you can root <Link> s using the basename prop on any <Router> .

Why does create React app need a server?

npx itself is a Node tool which allows you to run a package, in this case with Create React App, which allows you to easily start a new React project. The server that you see is simply to allow for the reloading of the app in response to file changes in real time. The server is only for use in development.


If you are using Chrome, this might be connected to webpack-dev-server (which create-react-app uses under the hood) issue described here.

Since this has been already addressed by create-react-app team, check the latest available version of react-scripts here: changelog, bump the react-scripts version in your package.json to match it and run npm install (or yarn install) in your project's folder to update to the latest version.


I bumped into this when the page was trying to render a huge load of data. Paginated the table and everything worked fine.