mswjs / interceptors

Low-level network interception library.
https://npm.im/@mswjs/interceptors
MIT License
535 stars 120 forks source link

`Response.type` throws in miniflare-like environments #478

Closed mattcosta7 closed 9 months ago

mattcosta7 commented 9 months ago

https://github.com/mswjs/interceptors/blob/3258f5cc62c472ba63f5c70e455d5b245c74a216/src/interceptors/fetch/index.ts#L106

In environments like miniflare, Request.type is defined as a getter that throws.

We should write some tests to ensure that interceptors can work in miniflare (jest/vitest environment miniflare should support us here) and update to check something else or ignore this check entirely if the property access throws an error (like miniflare's does)

related to https://github.com/mswjs/msw/issues/1834

kettanaito commented 9 months ago

Released: v0.25.10 🎉

This has been released in v0.25.10!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.