1

I have NextJS app with SSG. This functionality was added recently and according to it I should do next-export after next-build to get static files. But after appearing in 9.4 of Incremental Static Regeneration I need to keep server on by npm-start command (in my case I use custom server file with next-express functionality). It works good locally and It works good when I get artifact from Azure. But It doesn't work globally when it will be deployed finally. Help please

  • In order to help people trying to answer the question, Please attach any deployment/access logs that provide a meaningful error or stack trace. – Ramakay Jul 22 '20 at 17:20

1 Answers1

0

Through my attempts, I found that it is impossible to install globally or use next in Azure Web App. That is, it cannot be deployed through Github.Deploying using other methods such as FTP cannot run successfully. It should be related to the azure node environment.

But the method provided in this post says that it can be processed by adding web.config. I think it should be useful and helpful to you. Please read it carefully and try it.

You also can read this document, maybe it useful to you.

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • yeah, I have web.config, it worked while I used SSR. but when I moved to SSG and start it through `node server.js ..` - it stopped – Roman Remniov Jul 23 '20 at 08:03
  • @RomanRemniov Sorry, what is the full name of ssg? I always thought ssg was the content of nextjs. – Jason Pan Jul 23 '20 at 08:05
  • SSG - static site generation, earlier It worked only with `next-export` but couple months ago Next added feature Incremental Static Regeneration which works with usual server after `next-start`. It works on vercel but It doesn't on Azure – Roman Remniov Jul 23 '20 at 08:28
  • @RomanRemniov https://techcommunity.microsoft.com/t5/azure/deploy-next-js-with-azure-static-web-app-service-and-github/m-p/1413932 – Jason Pan Jul 23 '20 at 08:37
  • thanks, but this way through next export (outdated way) – Roman Remniov Jul 23 '20 at 09:38