ShanonJackson / nextjs-azure-function

Builds your NextJS Api folder into a single azure function.
25 stars 7 forks source link

NextJS 13 support #3

Open johnmark-qrious opened 7 months ago

johnmark-qrious commented 7 months ago

Hi Shanon,

John here, I'm just wondering if you've managed to do this type of deployment in Azure using NextJS13?

I think this will no longer work since Next deprecated the property target which I think was injected by @sls-next/lambda-at-edge

(just asking on behalf of Zespri MCS, we're trying to move the project to Next13, we might need to downgrade it to 12 if there are no longer any options)

Thanks in advance :)

ShanonJackson commented 7 months ago

@johnmark-qrious - Good to hear from you.

No longer support this as I'm now hosting on AWS / Fastly which is working really well for us (Next@14)

I think in terms of hosting on azure

https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-hybrid#adding-an-api-route https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-hybrid

Should these not work will leave two options: 1: Write your own wrapper around NextJS build output for Azure Compatibility (difficult) 2: Dockerize the application using output: "standalone" which will make NextJS build output be deployable as a server, meaning this server will serve .html/.css/.js files as well as /api routes. This means losing the benefits of serverless until Azure finishes support.