You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having installed the azure-swa adapter and successfully built and deployed my app, I find the target environment responding with an HTTP status code 500.
There is almost no information (stack traces etc.) available in Azure. Application Insights shows that the requests have been processed by /api/render within reasonable time, but with status code 500.
I have tried to run the Azure build locally with swa start. Instead of a 500, the app is returning 404 for all routes, but it does serve static assets like the robots.txt file.
While starting up, the app displays the following messages:
[api] Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
[api] [2024-12-16T15:49:09.459Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
I found a pointer here that an additional file named local.settings.json is needed. I have put the suggested contents into azure-functions/local.settings.json. The first message has now disappeared.
The second message seems to be caused by a version mismatch between the @azure/functions package that Qwik uses (3.5.1) and the Azure Core Function Tools package that the SWA package automatically downloads during the Azure build. According to func-core-tools.js in the @azure/static-web-apps-cli package, all node.js versions above 13 will (now) download major version 4 of the Azure Core Function Tools.
function detectTargetCoreToolsVersion(nodeVersion) {
// Pick the highest version that is compatible with the specified Node version
if (nodeVersion >= 14 && nodeVersion <= 20)
return 4;
if (nodeVersion >= 10 && nodeVersion < 14)
return 3;
if (nodeVersion >= 8 && nodeVersion < 10)
return 2;
// Fallback to the latest version for Unsupported Node version
return 4;
}
This requires some adjustments. Among some other changes, the functions.json file, which the Qwik adapter currently generates, has been replaced.
The text was updated successfully, but these errors were encountered:
rondonjon
changed the title
[🐞] Azure/SWA: app returns HTTP status 500
[🐞] Azure/SWA: deployed app returns HTTP status 500
Dec 13, 2024
rondonjon
changed the title
[🐞] Azure/SWA: deployed app returns HTTP status 500
[🐞] Azure/SWA: outdated dependency on @azure/functions v3 results in broken deployments and HTTP status 500
Dec 16, 2024
rondonjon
changed the title
[🐞] Azure/SWA: outdated dependency on @azure/functions v3 results in broken deployments and HTTP status 500
[🐞] Azure/SWA: dependency on outdated @azure/functions v3 results in broken deployments and HTTP status 500
Dec 16, 2024
Hello @wmertens and @shairez, it seems that you have worked on this adapter in the past. Could you please check if it is still working for you and share a quick update?
I have tried to upgrade manually to v4 by patching the config files and replacing functions.json with an index.js file with a modified Azure function handler (the context and request parameters have been flipped and modified). Eventually I got the bundle to display the start page, but it produces 404s for all other routes. I suspect that more changes may be needed in the vite adapter and the request handler, but that part of the code kind of overwhelms me 🫨
Which component is affected?
Qwik Runtime
Describe the bug
Problem
Having installed the azure-swa adapter and successfully built and deployed my app, I find the target environment responding with an HTTP status code 500.
There is almost no information (stack traces etc.) available in Azure. Application Insights shows that the requests have been processed by
/api/render
within reasonable time, but with status code 500.To reproduce
Repository (just a qwik starter repo with azure-swa added): https://github.com/rondonjon/qwik-swa-deployment-repro
Deployment URL: https://ashy-wave-05e72ba03-preview.westeurope.4.azurestaticapps.net
Reproduction
https://ashy-wave-05e72ba03-preview.westeurope.4.azurestaticapps.net
Steps to reproduce
npx swa deploy
System Info
Additional Information
I have tried to run the Azure build locally with
swa start
. Instead of a 500, the app is returning 404 for all routes, but it does serve static assets like therobots.txt
file.While starting up, the app displays the following messages:
I found a pointer here that an additional file named
local.settings.json
is needed. I have put the suggested contents intoazure-functions/local.settings.json
. The first message has now disappeared.The second message seems to be caused by a version mismatch between the
@azure/functions
package that Qwik uses (3.5.1) and the Azure Core Function Tools package that the SWA package automatically downloads during the Azure build. According tofunc-core-tools.js
in the@azure/static-web-apps-cli
package, all node.js versions above 13 will (now) download major version 4 of the Azure Core Function Tools.This requires some adjustments. Among some other changes, the
functions.json
file, which the Qwik adapter currently generates, has been replaced.The text was updated successfully, but these errors were encountered: