unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

Returning Web Response in Azure SWA is not working #2590

Open walmartwarlord opened 2 months ago

walmartwarlord commented 2 months ago

Environment

Nuxt: 3.12.3 Node: 20

Reproduction

Deploy a basic Nuxt app with an api that returns a web response like

export default function eventHandler((event) => {
  return new Response(JSON.stringify({ username: 'test' }), { headers: { 'Content-Type': 'application/json' } })
})

Describe the bug

Instead of the actual json, Im getting an empty object returned when deployed to Azure SWA:

// /api/user
{}

Additional context

No response

Logs

No response