sindresorhus / ky-universal

Use Ky in both Node.js and browsers
https://github.com/sindresorhus/ky
MIT License
670 stars 20 forks source link

globalThis.Request is not a constructor #44

Closed steveoh closed 2 years ago

steveoh commented 2 years ago

In node v16.16.0 with

"ky": "^0.31.3", "ky-universal": "^0.10.1"

my script throws

node_modules/ky/distribution/core/constants.js:6
        hasContentType = new globalThis.Request('https://a.com', {
                         ^

TypeError: globalThis.Request is not a constructor

This appears to have been introduced at ky 0.31.2