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

Unable to use fetch API on Azure Static web apps #2676

Open censujiang opened 1 month ago

censujiang commented 1 month ago

Environment

node:20 in azure static web apps

Reproduction

https://stackblitz.com/edit/github-p3avvp?file=server%2Froutes%2Findex.ts

Describe the bug

In this product environment of Azure, even if it is set to node:20, it still does not include the fetch api

https://github.com/nuxt/nuxt/issues/28611

Additional context

A valid Azure subscription is required to test Static web apps. This error only occurs in the cloud, not in the local simulator.

Logs

{
    "url": "/",
    "statusCode": 500,
    "statusMessage": "",
    "message": "[GET] \"https://www.baidu.com\": <no response> _fetch1 is not a function",
    "stack": ""
}
### Tasks