Custom server with express not working in production mode
See original GitHub issueI was running my project with express, then I saw an issue in production mode so I replicated the custom-server-express
example and the same issue was there:
(using nextjs beta 36) It is only happening with npm run start
. everything seems to be fine in dev.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Problem to deploy Next App and Express API as a custom server
5. I change the application mode to development and then this shows up. I feel hopeless, and don't know what to do anymore....
Read more >node.js - Express routes not working on production server
I am struggling to control the flow using a Node Express application on my production server. The home page displays "homepage" but the ......
Read more >Express Tutorial Part 7: Deploying to production
This tutorial provides some guidance on your options for choosing a hosting site, a brief overview of what you need to do in...
Read more >Advanced Features: Custom Server - Next.js
If your project uses a custom server, this behavior may result in the same content being served from multiple paths, which can present...
Read more >Set Up Next.js with a Custom Express Server + Typescript
The problem comes from tsconfig.json , there is a line "module": "esnext" . ... Before spinning up the server in production mode, ...
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 Free
Top 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
The reason is
next start
only runs the next.js part…You should
next build
then start withNODE_ENV=production node server.js
You can also trigger the build programmatically from
dist/server/build
@reel FYI https://github.com/zeit/next.js/issues/1326#issuecomment-283563364 has been fixed 👌 If there is no build it’ll show a warning when using custom server to 😄