Skip to content
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

failed to deploy custom-server-express to Azure Web App #5043

Closed
JeryLu2020 opened this issue Aug 28, 2018 · 9 comments
Closed

failed to deploy custom-server-express to Azure Web App #5043

JeryLu2020 opened this issue Aug 28, 2018 · 9 comments

Comments

@JeryLu2020
Copy link

JeryLu2020 commented Aug 28, 2018

Bug report

Describe the bug

when deploying the project to Azure, in the CMD of Kudu, run "npm start" can see the success message "Ready on http://localhost:3000"
However the website still shows 500.
I already run "npm run build" and generated the .next folder, but how can I set the web.config so that the IIS can find the access for the project??
https://jery-nextjs.azurewebsites.net/

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Download and build "custom-server-express" locally
  2. Use FTP to deploy the code to Azure or directly drag the files to Azure Kudu
  3. Add web.config file and set the entrance to "server.js"
  4. See error 500

Expected behavior

the website should be running OK like local environment
image

Screenshots

error page

image

file directory

image

web.config

image

so where is the entrance for the next JS in IIS? in the .next folder?

System information

  • OS: Windows
  • Browser (if applies) chrome
  • Version of Next.js: latest
@JeryLu2020
Copy link
Author

JeryLu2020 commented Aug 28, 2018

for react app the "index.html" is the entry point in the web.config, but fot Next, it is not, so I wonder how can this be achieved? thanks in advance!!

@timneutkens
Copy link
Member

timneutkens commented Aug 28, 2018

I'm not sure what to do with this. I guess you'll have to ask support from Azure. All Next.js needs is next build and next start (or NODE_ENV=production node server.js when using a custom server) to boot up.

@timneutkens
Copy link
Member

Feel free to contribute an example back when you figure this out.

@JeryLu2020
Copy link
Author

@timneutkens thanks! but when run "next build" and "next start", will the server.js read the client code from the ".next" folder?

@timneutkens
Copy link
Member

next start doesn't use your custom server. NODE_ENV=production node server.js will. .next holds the build output that is needed to boot up the production application.

@JeryLu2020
Copy link
Author

@timneutkens still doesn't work, seems no good solution yet.....I'll have to implement these features for React myself...

@timneutkens
Copy link
Member

If it doesn't work with Next.js I doubt it'd be any different when you implement your own custom server.

@JeryLu2020
Copy link
Author

@timneutkens it works perfectly in local, also works good in Linux, but failed with Azure PaaS

@chcepe
Copy link

chcepe commented Dec 9, 2018

Were you able to deploy next with custom server on Azure App Service?

@lock lock bot locked as resolved and limited conversation to collaborators Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants