-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnhandledPromiseRejectionWarning when deploying custom server to now #1018
Comments
I tried adding a
|
I think you'll need to use |
Huh, I would've expected Now.js to set NODE_ENV to 'production' the way Heroku does. I checked for const app = next({ dev: process.env.NODE_ENV !== 'production' && !process.env.NOW }); |
@jessehattabaugh we didn't want to be surprising. After all, you could launch processes to simulate development, you could run builds, etc. What do you think? |
I think it's more intuitive to do |
Sounds good. Thanks a lot for your feedback |
This is only the case when running a custom server. |
FWIW, this exact thing happened to me the first time I deployed a custom server. I also expected now to set It makes sense why it's set up this way; I just had to make the mistake once to learn it. I think this specific case could be improved a lot if Next.js could catch this error and log a helpful message. Maybe it could even look at |
agree with @bryanrsmith if the error could also point to this thread and/or a doc about this issue. I encountered it after following the custom express example but not as closely as I should have. I missed the |
In order to use a hostname other than
localhost
I'm creating a custom server as @arunoda advised in #1010.My
package.json
scripts are as followsRunning
$ npm start
works as expected, but when I deploy to now using$ npm run deploy
I get the following outputmay be related to #452 or #300
The text was updated successfully, but these errors were encountered: