question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Website in dev working perfectly, but when running npm build + npm start (in production) doesn't work.

See original GitHub issue

Bug 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:

  1. See Project on the client folder of the repo / Clone https://github.com/JoaoGuimaraes22/Prodity/tree/master
  2. Run npm install
  3. Run npm run dev, to see it working fine (routes to /users/login and /users/signup) 4 Then run npm run build and npm 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:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JoaoGuimaraes22commented, Apr 2, 2020

Hey man, it works! Big thanks Fabiano.

0reactions
balazsorban44commented, Jan 30, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found