Open Blaxzter opened 10 months ago
The Nuxt adapter builds a specific bundle for the static assets and the serverless Azure Functions, based on the knowledge that it is building for Azure Static Web Apps. This is documented in Nitro, Nuxt's builder https://nitro.unjs.io/deploy/providers/azure#azure-static-web-apps. You could follow those docs to build locally and get the configuration file from that.
The limitation you are encountering is specific to to Static Web Apps' size restrictions: https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#restrictions As you can see, the 20KB is the max file size of the configuration file.
To resolve this problem, you'd have to either reduce the generated routes that require specific configuration (ie handle more of these dynamically server-side) or use another service than Azure Static Web Apps
When i run the npx @azure/static-web-apps-cli start .output/public
command, I get this output:
Welcome to Azure Static Web Apps CLI (1.1.4)
***********************************************************************
* WARNING: This emulator may not match the cloud environment exactly. *
* Always deploy and test your app in Azure. *
***********************************************************************
[swa]
[swa] Using workflow file:
[swa] U:\Programming\project\.github\workflows\azure-static-web-apps-victorious-smoke-0925ac503.yml
[swa]
[swa] Found configuration file:
[swa] U:\Programming\project\staticwebapp.config.json
[swa]
[swa]
[swa] Serving static content:
[swa] U:\Programming\project\.output\public
[swa]
[swa] Azure Static Web Apps emulator started at http://localhost:4280. Press CTRL+C to exit.
[swa]
[swa]
And everything works as intended with refreshes and everything.
The staticwebapp.config.json
is the same as mentioned above.
So why can't the deployment process not generate a new staticwebapp.config.json when i provide one?
I have a Nuxt3 app that generates a bunch of routes for a static site. When I run the autogenerated GitHub workflow file that uses the Azure/static-web-apps-deploy@v1 action I see all the successful Oryx generate logs only to see at the end:
To note:
Encountered an issue while validating staticwebapp.config.json: The file size exceeds the limit of 20 KB
The staticwebapp.config.json that is present in the app_location (which is /) is 464 Bytes and looks like this:
I tried the Oryx build locally, but that doesn't generate a staticwebapp.config.json, and I don't find any documentation that it would generate one. So I don't understand why it tells me I have a config file bigger than 20kb when it is just 464 Bytes.
To Reproduce No clue
workflow yaml file:
Repo is sadly not public.
Expected behavior A running static web app and a reasonable error message.
Device info (if applicable): I've run the runner on a self-hosted runner and the GitHub runner. I thought I'd be able to check the staticwebapp.config.json in the self-hosted runner, but the docker container was deleted too fast for me to search for it and copy it out. The _work directory that was set in the runner config does only contain the one staticwebapp.config.json that i provided.
Additional context We had the application successfully deployed to Vercel and AWS amplify.