Open krisnashaypp opened 3 months ago
After struggling from the same problem, this is how I fixed it for my app. First, no work around worked for me on Azure static web app even the paid plan! So I shifted to Azure app service and it won't work until you include some files and modifications. I wrote all about it and added the files needed, code and references here Just jump to the solution part.
I hope this helps.
@EmanH5
I also migrated to App Service, but there was no need to do manual configuration or change the scripts in the package.json.
This is the guide I followed: https://dev.to/paulriviera/deploy-nextjs-14-app-to-linux-azure-app-service-3d34
and I think most of the things are done automatically because of the standalone
output config.
After struggling from the same problem, this is how I fixed it for my app. First, no work around worked for me on Azure static web app even the paid plan! So I shifted to Azure app service and it won't work until you include some files and modifications. I wrote all about it and added the files needed, code and references here Just jump to the solution part. I hope this helps.
@EmanH5 I also migrated to App Service, but there was no need to do manual configuration or change the scripts in the package.json. This is the guide I followed: https://dev.to/paulriviera/deploy-nextjs-14-app-to-linux-azure-app-service-3d34 and I think most of the things are done automatically because of the
standalone
output config.
@janosgy That's weird, I tried it without changing package.json but it didn't work at all. in my experience, the only approach that worked with me was adding the server and config files I mentioned and change package.json scripts to node Maybe it depends on next's version then? not sure really but at least it seems for sure needs to be an Azure app service to work 👍🏻
It is unacceptable and shameful for Azure to leave such a serious problem unexplained. We have switched from Azure SWA to IIS. Everything works much much faster, the build configuration is much easier, and we are not encountering any unexplained errors. For those experiencing the problem, the only absolute solution seems to be not using SWA...
NOTE: We were using paid plans.
@janosgy @EmanH5 we also have a Next.js static web app (where both frontend and backend are hosted on the static web app itself). Did you guys move your backend only to Azure App Service? Or your entire application?
This is how I do it on Azure, but I get "Internal Server Error":
We also moved to app service. So far so good. We also noticed the application is performing better. It also catch more next.js exceptions to App Insights
Experiencing the same issue for a while now.
@janosgy @EmanH5 we also have a Next.js static web app (where both frontend and backend are hosted on the static web app itself). Did you guys move your backend only to Azure App Service? Or your entire application?
This is how I do it on Azure, but I get "Internal Server Error":
- Create an app service plan with P1V3 tier, with Linux OS.
- Create a web app an associate it with the app service plan.
- In Azure portal, go to the static web app -> APIs -> Configure linked backend -> add the created linux web app
@mfathi91 I moved the entire app to Azure app service and it is working smoothly now with the configurations I mentioned in my post. Your steps also make sense as another approach that could work if you want to only move the backend but since you have internal server error then there might be an issue with the APIs setup or the Access permissions to the Azure App service. Maybe CORS? not sure.
We've been having the same issue, what has helped is trying to update a dummy "environment variable" to trigger a back-end restart. If that doesn't help, trigger the same deploy has helped.
Same issue here. Paid SWA service in West Europe. Only fix is redeploying
Same issue here with paid SWA service. 🔥 🔥
Hybrid NextJS apps are still in Preview, so MSFT support wouldn't help much. The only way seems to jump to Azure App Service.
Same issue.
Same issue NextJS 14 on Paid SWA service
Same issue Next.js 14.2.3 with NextAuth 4.24.7, redeploying seems to fix the problem - after redeploying yesterday, the issue has not resurfaced yet.
After several days with the same issue I moved to app services. Used this guide for the project setup https://dev.to/paulriviera/deploy-nextjs-14-app-to-linux-azure-app-service-3d34 and as I'm using azure pipelines I followed this https://www.azure365pro.com/deploy-next-js-app-on-azure-app-service-with-azure-devops-pipelines-2/ for the pipeline script and the service connection configuration. Something to point out, had some issues when using the free tier app service layer, after moved to the paid one it just worked 🤑
OP here, I moved my app to Azure Container Apps and i've been very pleased with that service so far. With little knowledge about docker and ACA I was able to get up and running within a day and now I'm moving my backend into the same service since you get a lot of synergies. I recommend everyone give it a look before automatically going with app service.
I moved from it to vercel. For the life of me, I couldn't find a fix no matter how much I refactored my code. Muck Ficrosoft on this one
Same issue here, using NextJS 14 on Paid SWA service
Experiencing the same issue, build runs no issue locally, but when done on azure pipelines sometimes build is created successfully and sometimes it isn't. And the error message of the post. Using Next 14
We are facing same issue Nextjs: 14.2.3 Node: 20.11.0
We are also experiencing the same issue on a paid SWA service and is considering other options if this isn't fixed soon. Occasionally the API routes is very slow or we get the error message "Backend call failure".
I believe this issue will only grow. It seems that Azure functions are not production-ready. If you can, move away from Azure, if you can't, migrate to App Service.
same here
I am also experiencing the same issue
for those who are suffering this fixed my issue.
https://github.com/Azure/static-web-apps/issues/1496#issuecomment-2168383060
for those who are suffering this fixed my issue.
I think most of us in this thread have issues with the application suddenly stops working with the "Backend call failure" message. The deploys have been flaky but I don't think that's the real underlying issue.
We had "Backend call failure" this morning and a re-deployed "fixed" it, but I can assure you we will soon see the "Backend call failure" again. Just happy we're not using it for anything else than a small internal app... Even so, we're currently migrating away from SWA and will use Container Apps instead as this is not acceptable at all.
After redeploying upon encountering this issue a week ago, the issue was temporarily fixed until today. Had to redeploy again for temporary fix. Microsoft, please look at this issue. Edit 2 hours later: Got the error again just now, after having redeployed earlier... This is the first time that we experience such a high frequency of the error.
Note that no code changes have been made to the project for many weeks.
We've now moved away from SWA to Azure Container Apps and the migration was a breeze. It feels so much more stable now. It isn't free, but it's very cheap.
I used this example to start us off: https://github.com/vercel/next.js/tree/canary/examples/with-docker
Same issue here as well..
Adding my voice to the chorus of those running into this issue. I was really hoping SWA would be a viable solution. Off I go to build a container I guess....
same issue here
same issue
same issue here
We have a nextjs app that has been running as a static web app for many months, in recent days it has started having intermittent failures were all you see is "Backend call failure", usually it starts working by itself after a while but sometimes it takes a longer time.
It's running next 13.5.6, thanks