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
{{ message }}
Repository navigation
Returning Web Response in Azure SWA is not working #2590
Returning a new Response should be supported in handlers. We should investigate why body (which can be a stream) is not handled, it is a bug.
I verified that this is also a bug in the azure-function preset.
The actual return value from API call is this, but Azure Static Web App filters that out:
I’m running into something similar with a “tanstack start” app I’m trying to deploy to a SWA. Right now it returns a ReadableStream, but the azure functions v3 programming model doesn’t support that. A quick workaround could be to check the body type and turn the stream into a string. I can open a PR for that if you’d like.
On the other hand, v4 does support streams. I’ve seen a few issues about upgrading to v4, but I’m not really sure what the current status is.
I’m running into something similar with a “tanstack start” app I’m trying to deploy to a SWA. Right now it returns a ReadableStream, but the azure functions v3 programming model doesn’t support that. A quick workaround could be to check the body type and turn the stream into a string. I can open a PR for that if you’d like.
On the other hand, v4 does support streams. I’ve seen a few issues about upgrading to v4, but I’m not really sure what the current status is.
@jvpelt did you find a workaround for this? I'm hitting the same issue with Tanstack Start. I'm just getting a {} response.
Activity
itpropro commentedon Oct 1, 2024
I was able to reproduce this. But there are alternative options to construct and send a response that work with SWA and are more "Nitro like":
Directly returning the object (Nitro automatically sets the headers):
Using the send function:
Both are tested and confirm to work with Azure Static Web Apps.
Do you want to keep this issue open @pi0 or would you agree not to use the native Response object and instead use the Nitro utilities?
pi0 commentedon Oct 1, 2024
Returning a new
Responseshould be supported in handlers. We should investigate whybody(which can be a stream) is not handled, it is a bug.itpropro commentedon Oct 2, 2024
I verified that this is also a bug in the
azure-functionpreset.The actual return value from API call is this, but Azure Static Web App filters that out:
It is definitely cause by Nitro handling the response binding for Azure Functions.
We should address that with the update to Azure Functions runtime 4.
pi0 commentedon Oct 2, 2024
thanks for investigation @itpropro. Does runtime v4 support accept
ReadableStreamas validbody?itpropro commentedon Oct 2, 2024
No, we can also release the bug fix beforehand independently of the v4 update.
jvpelt commentedon Sep 17, 2025
Hi @pi0,
I’m running into something similar with a “tanstack start” app I’m trying to deploy to a SWA. Right now it returns a ReadableStream, but the azure functions v3 programming model doesn’t support that. A quick workaround could be to check the body type and turn the stream into a string. I can open a PR for that if you’d like.
On the other hand, v4 does support streams. I’ve seen a few issues about upgrading to v4, but I’m not really sure what the current status is.
pi0 commentedon Sep 17, 2025
If you can please feel free to open a PR to upgrade SWA in v3 branch.
bishsbytes commentedon Oct 22, 2025
@jvpelt did you find a workaround for this? I'm hitting the same issue with Tanstack Start. I'm just getting a
{}response.thomasschaller1 commentedon Feb 24, 2026
Any news about this one?
derkoe commentedon Apr 29, 2026
I'm using the workaround from @Xiang-CH from here https://github.com/Xiang-CH/tanstack-azure-swa-template and it works without issues.
Can anyone have a look at their PR?
pi0x commentedon Oct 15, 2026
Fixed in Nitro v3 by #4195 (azure-swa response body no longer returns
{}). Closing for v2 since it is in maintenance.Triaged with AI assistance.