DEV Community

TheGuyHiding
TheGuyHiding

Posted on

React server taking too long to start up and unable to edit without shutting down server

I'm having an issue with npm start, it takes almost 2 minutes before the server starts and opens the page on my browser. Then whenever I make changes to my code then save it and reload the page, the server does not update the page with the new changes, thus forcing me to stop the server and restart it. I've look for solutions on stack overflow but was unable to solve my issue. Any support would be greatly appreciated.

Top comments (3)

Collapse
 
amn3s1a2018 profile image
Amn3s1a2018

You need to be more specific with your questions. At first read: stackoverflow.com/help/how-to-ask
If you ask better questions, you will get answers.
As already mentioned, there are many react starters. If you stuck with one, try another. Esbuild and Vite are nice options too, besides NextJs and Gatsby ...
Or maybe you should use npm run dev instead of npm start ;)

Collapse
 
theguyhiding profile image
TheGuyHiding

Turns out the problem wasn't react or npm, rather where I had my repo from GitHub. If you try running a react app from a location that doesn't contain the npm information it will more or less break. Regardless, thank you to all who responded.

Collapse
 
subhendu17620 profile image
Subhendu Maji

If you have bootstrapped the app with create-react-app, it comes with webpack bundler
Try 'esbuild' bundler esbuild.github.io/

Or
You can try vite app with react.
vitejs.dev/