Improved support for Next.js (Preview) for Static Web Apps #1428
Replies: 6 comments
-
this is great news! thank you :) |
Beta Was this translation helpful? Give feedback.
-
Congrats on the improved support for Next.js on Static Web Apps. 🎉 This new release fixes a lot of our concerns/issues. Next 14 is now working nicely including ISR. Especially the dedicated compute for the azure functions results in much better performance in the SSR. In the region of the static webapp (West Europe) the performance is steady between 200 and 300 ms. With some outliers (not sure where those come from). Also no more coldstarts of the function after the first time hit. You can clearly see that in other regions the latency is a lot higher, up to 2,5 sec avg in West-US. Furthermore (Local) development and deployment using the SWA CLI would be really usefull. We also use the SWA CLI in our devops pipeline instead of the Static Web Deploy task. Overall a great achievement of the team, keep up the good work! Looking forward to GA . |
Beta Was this translation helpful? Give feedback.
-
Should we still be using Azure/static-web-apps-deploy@latest for GitHub actions deployment? If I set output = standalone as you suggest above then what values should I use here??
|
Beta Was this translation helpful? Give feedback.
-
@thomasgauvin @Reshmi-Sriram Can you point us to an example of how to configure the azure-pipelines.yml for deploying a server-side Next.js app using Azure DevOps, please? This is what I have so far, and in the CD process, I'm getting an error, but in Azure DevOps I can see the artifacts downloaded correctly jobs:
- deployment: DeployWebapp
displayName: Deploying to Development
environment: develop
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact@2
displayName: Download Artifacts
inputs:
artifact: webapp
path: $(Build.SourcesDirectory)/webapp
- task: AzureStaticWebApp@0
displayName: Deploy to Azure Static WebApp
inputs:
app_location: "/webapp"
output_location: ""
app_build_command: 'echo No build required' # Skip the Oryx build by using a no-op command
env:
azure_static_web_apps_api_token: $(deployment_token)
....
|
Beta Was this translation helpful? Give feedback.
-
Is there any information on when support for Next.js (Preview) for Static Web Apps will move out of preview and into production? In our work, we need this functionality, as we do not deploy preview features to production. It’s fantastic that this functionality is supported! Alternatively, is there a roadmap that I could refer to? |
Beta Was this translation helpful? Give feedback.
-
Does anybody know if it's possible to give the App Service that runs the server side functions access to a private vnet? I'd like to be able to give it access to an api that isn't public. |
Beta Was this translation helpful? Give feedback.
-
Hi folks!
We’ve rolled out improvements to our Next.js support on Azure Static Web Apps, specifically as it regards support for newer Next.js versions, and new server-side Next.js features. Here’s the blog post for the details on the announcement.
Here’s the TLDR:
staticwebapp.config.json
: You can now handle header configurations, redirects, and routes permissions with thestaticwebapp.config.json
file. Certain configurations also need to be configured within thenext.config.json
configuration file in order for the Next.js server to expect certain behaviors. Some features are unsupported, such as the navigation fallback, which is configured on your behalf for the Next.js site.This improved support for Next.js current and future versions is enabled by the fact that Next.js backend functions are now hosted on dedicated App Service plans, with no change to current Static Web Apps plans. Next.js static assets continue to hosted on Static Web Apps’ globally distributed content host.
We continue to gather feedback, here's how to chime in:
We continue to gather feedback on our support for Next.js, and are actively tracking these issues which are currently affecting some Next.js sites. Please contribute to these threads if you are affected by these issues.
Static Web Apps related issues:
Next.js related issues:
If you have general questions, feedback or issues which are not tracked above, please share them in this thread.
Notes
Enabling standalone
Deployment sizes are now 250mb, but you may still want to use standalone to deploy apps of larger size or decrease deploy times. To do so, you must do the following.
Enable standalone in
next.config.json
:Static Web Apps requires that your standalone output is left in the default location (
.next/standalone
).Specifying Node version
Some recent versions of Next.js require versions of Node.js above the default, to specify the Node.js version in your Next.js site, add the following within your
package.json
:Previous announcements regarding Next.js: #1066, #921
Happy shipping! 🚀
Beta Was this translation helpful? Give feedback.
All reactions