mswjs / msw-storybook-addon

Mock API requests in Storybook with Mock Service Worker.
https://msw-sb.vercel.app
MIT License
410 stars 39 forks source link

Getting global is not defined error #42

Closed Secretmapper closed 3 years ago

Secretmapper commented 3 years ago

Whenever using msw-storybook-addon, I get a global is not defined error.

The fact that I'm using Storybook for Vite might be related

Secretmapper commented 3 years ago

Removing server side rendering support (ie, removing global variable, IS_BROWSER else) makes msw work.

Probably because Storybook for vite doesn't use babel(?) and so preset-env doesn't get loaded

brettdewoody commented 3 years ago

Where did you remove SSR support to make this work?

kettanaito commented 3 years ago

This should be resolved in #41. Please wait for the next add-on release. Thank you.