Closed gabrielizalo closed 1 year ago
Hi @gabrielizalo Can you try specifying the node version in package.json
under engines
section and see if you can use node 16. For more details: https://edi.wang/post/2022/1/27/how-to-specify-nodejs-version-when-building-azure-static-web-app
Also just curious, as you're providing api_location and also output_location, are you using html export
feature of NextJS? If so, please check if you need to add is_static_export: true
in the config. More details at: https://learn.microsoft.com/en-us/azure/static-web-apps/nextjs#static-html-export
@vivekjilla Thanks for the tip. You were right. I used: "node": "16.14.2"
but now I'm getting this error:
The content server has rejected the request with: BadRequest
Reason: The size of the function content was too large. The limit for this Static Web App is 104857600 bytes.
Also you asked me about providing api_location
. Well. I'm new to Next JS. I just created an app that has the following:
src/pages/api
that loads in my postman as ...my-server/api/
I don't use html export
but yes the Next JS API pages to create my endpoints.
For my web app I think it's not necessary the is_static_export: true
.
Should I delete the api_location: "/api" # Api source code path - optional
line in my yaml?
Any ideas about the new error?
IN this document: Deploy hybrid Next.js websites on Azure Static Web Apps said that:
The maximum app size for the hybrid Next.js application is 100 MB.
So I can't used Azure for my app. 😢
Hey @gabrielizalo sorry for this inconvenience. Can you please checkout this discussion and see if the workaround mentioned here helps reduce your app size: https://github.com/Azure/static-web-apps/issues/769#issuecomment-1282035151
@vivekjilla Yes... I already tried it. But as I'm using MUI and other libs my project is very big. Like 200 MB. Hehehe
Describe the bug
I used the Azure wizard to publish a Next JS App in GitHub to a new Static Web App. The Azure Wizard uses this
yaml
file:azure-static-web-apps-brave-mud-030f7e20f.yml
My problem: Appears this error in the
Build and deploy job
:Summary:
Also in the details appears this error:
To Reproduce Just use the Portal Azure Wizard to publish a Next JS App.
Expected behavior Build and deploy should work without errors.
Additional context How can I fix the
yaml
file? In the one I have, that Azure provided, I can't setup Node version.