interceptors: Interceptor presets are no longer accessible for import
See this comment: https://github.com/mswjs/interceptors/pull/313#issuecomment-1436419369
It seems that when we added bundling for ESM/CJS, we didn’t consider some of the imports that are documented in the project’s documentation that say that presets should be imported like so:
import browserInterceptors from '@mswjs/interceptors/lib/presets/browser'
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 24 (24 by maintainers)
Commits related to this issue
- fix: export node and browser presets (#358) - Fixes #345 — committed to mswjs/interceptors by kettanaito a year ago
- Conditionally expose root browser files and types See https://github.com/mswjs/interceptors/issues/345#issuecomment-1712962587 — committed to blaenk/interceptors by blaenk 10 months ago
Thanks for the call out about Jest. That’s exactly the kind of thing I mean with respect to the various layers. I’m at least aware of the complexity there even if I don’t fully grasp every corner of it, I am aware enough of the complexity to respect it.
This is why in my case, I’m not even at the point of involving Jest, jsdom, ts-jest, etc.—I’m purely running
tsc --build
alone, without any TypeScript compiler plugins or anything like that. It’s as “vanilla” as it can get. I’m not going through a bundler like webpack/rollup/vite, etc.I haven’t reviewed the documentation to see if other things are invalid, I was just opening this issue based on the comment I linked so that it doesn’t get lost since the comment was on a closed PR.