Closed Taraslysak closed 5 months ago
OK, So I've played around it a little bit, and found out that one should use unstable_enablePackageExports: true
option in metro config, BUT it breaks axios lib.
So I ended up with this workaround:
import {
initialize,
mswLoader,
} from "../node_modules/msw-storybook-addon/dist/index.react-native";
Hi!
I'm trying to setup this add-on in React Native project. But when I try to connect to dev server I get this error:
Invariant Violation: [MSW] Failed to execute
setupWorkerin a non-browser environment. Consider using
setupServerfor Node.js environment instead., js engine: hermes
Which seems like my bundler choses wrong export option.
Here are my specs:
metro.config.js
.storybook/preview.tsx