nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Returning Web Response in Azure SWA is not working

Open targetlucked69 opened this issue 7 months ago • 5 comments

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

targetlucked69 avatar Jul 04 '24 07:07 targetlucked69