Cannot deploy nextjs ssr webapp using Azure Static Web Apps

ChokSheak Lau 0 Reputation points
2024-09-30T04:40:07.4033333+00:00

I have a nextjs app in my github repo, which has a webapp under the "/web" directory relative to the repo root. When I try to deploy in Azure Static Web Apps, the build will all succeed, but the deployment will always timeout after about 9-10 minutes after the "Finished Upload. Polling on deployment." step. Just wondering whether anyone knows what the issue here could be as this is a blocker for us using Azure. Thanks in advance.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
925 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 26,041 Reputation points Microsoft Employee
    2024-09-30T05:43:28.88+00:00

    ChokSheak Lau, Based on the scenario description, I understand that you are receiving timeout issue during the deployment of your Next.js SSR of Static WebApp.

    Are you referring to any Azure docs for the steps? How exactly are you provisioning the deployment?

    To narrow the issue, you may try the following steps (If you haven't done already so):

    -On a similar discussion thread that I'd handled , you may update build command.

    "build": "next build && cp -r .next/static .next/standalone/static/ && cp -r public .next/standalone/"
    

    -The maximum app size for the hybrid Next.js application is 250 MB. Use standalone feature by Next.js for optimized app sizes. If this is not sufficient, consider using Static HTML exported Next.js if your app size requirement is more than 250 MB.*

    -The hybrid Next.js websites on Azure Static Web Apps is in preview, kindly have a look at the :Unsupported features in preview -Some features are not supported, so please double check that your configuration does not rely on unsupported features like navigation fallback or certain properties in staticwebapp.config.json.

    Kindly let us know how it goes, I'll follow-up with you further.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.