Error AtlasError Documentation and Resolution

Azure Static Web Apps requires api_location to be empty for hybrid Next.js

'api_location' value should be an empty string ("") for Next.js applications which are not statically exported.

Azure Static Web Apps detected a non-static Next.js app and rejected the workflow configuration because api_location was set instead of being left empty.

'api_location' value should be an empty string ("") for Next.js applications which are not statically exporteddeployment
'api_location' value should be an empty string ("") for Next.js applications which are not statically exported.
  • The SWA workflow is deploying a hybrid Next.js app with api_location set to a separate Functions folder.
  • Azure Static Web Apps is handling the Next.js app as a non-static deployment and expects the workflow to leave api_location empty.
  • The deployment configuration mixes hybrid Next.js hosting with separate API path settings that the action does not accept.
  1. Set api_location to an empty string in the Azure Static Web Apps workflow for the Next.js deployment.
  2. Keep the app_location pointed at the Next.js app and let SWA handle the hybrid Next.js deployment path.
  3. If a separate API is required, use a deployment model that does not rely on the hybrid Next.js SWA workflow path.
Azure Static Web Apps: Deploy hybrid Next.js apps
Azure Static Web Apps api_location should be empty for Next.js | Error Atlas