Website in dev working perfectly, but when running npm build + npm start (in production) doesn't work.
See original GitHub issueBug report
Describe the bug
When developing, running npm run dev (next dev), the website works perfectly and the routing to other pages works as intended.
But, when running the project in production (next build + next start), the routing doesn’t work, for some reason.
I’m using, for routing <Link href="/users/signup"/>
, as intended in the documentation.
The routing isn’t dynamic
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- See Project on the client folder of the repo / Clone https://github.com/JoaoGuimaraes22/Prodity/tree/master
- Run
npm install
- Run
npm run dev
, to see it working fine (routes to /users/login and /users/signup) 4 Then runnpm run build
andnpm run start
, check the routes, they’ll not be working (or at least they didn’t work for me);
Expected behavior
Routing in production to work the same as it does in dev mode.
System information
- OS: Windows
- Browser: Chrome
- Version of Next.js: 9.3.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
npm start is doing absolutely nothing - Stack Overflow
1 Answer 1 · Delete the node_modules folder from your project directory · run the command npm install in the project directory ·...
Read more >webpack-dev-server - npm
Start using webpack-dev-server in your project by running `npm i ... Note: While you can install and run webpack-dev-server globally, ...
Read more >Troubleshooting Node.js Deploys - Heroku Dev Center
Check the buildpack · Compare Node and npm Versions · Make sure the lockfile is up to date · Don't check in generated...
Read more >Using Npm Scripts as a Build Tool in 2022 - Delicious Brains
There isn't a plugin for the package you want to use. · The plugin is out of date and doesn't support the underlying...
Read more >10 best practices to containerize Node.js web applications ...
/usr/src/app RUN npm install CMD "npm" "start". Copy that to a file named Dockerfile , then build and run it. $ docker build...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey man, it works! Big thanks Fabiano.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.