I had the same issue. I eventually had to edit a portion of my package.json
file from:
"build": "next build",
to "build": "next build && next export",
Deploying Nextjs app to Azure Static Web App fails on build
Hi,
I've been following the guidelines to deploy NextJS application on azure as Static Web App, but unfortunately getting build failed on the build with "The app build failed to produce artifact folder: 'out'. Please ensure this property is configured correctly in your workflow file." error. We've tried the solutions on blogs and already asked questions, but we are not concluded for the solutions. The NextJS Apps does not have an .html page, some said that is the reason but I should not be needing to change the NextJS to SPA app.
2 answers
Sort by: Most helpful
-
Solomon metta 11 Reputation points
2022-08-12T15:56:15.757+00:00 -
Jani Hyytiäinen 5 Reputation points
2023-01-18T01:37:26.5966667+00:00 Turns out, the
output_location
is relative toapp_location
.F.ex. if your output directory is
src/out
, you should have the following:- task: AzureStaticWebApp@0 inputs: app_location: 'src' app_build_command: 'npx next build' output_location: 'out'