You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When @storybook/addon-react-native-web is used, yarn build-storybook will not show stories that contain a story with a .play function/interaction (using @storybook/addon-interactions).
There are no errors during build, but an error does appear in the console when running the built storybook:
Unexpected error while loading ./stories/Page.stories.tsx: exports is not defined
ReferenceError: exports is not defined
at ./src/stories/Page.stories.tsx (http://localhost:6006/main.52cda89e.iframe.bundle.js:1:11360)
These stories are visible when you run yarn storybook but not shown when you run yarn build-storybook.
Note, this is not restricted to interactions, it seems the same bug exists for any async function added as a property to the story,
i.e.
// no issueMyStory.anything=()=>{};// causes story to be excluded when addon-react-native-web is usedMyStory.anything=async()=>{};
penx
changed the title
Stories with play functions are silently excluded in production when using addon-react-native-web
Stories with play functions are excluded in production when using addon-react-native-web
Sep 29, 2022
After further investigation, I think this is due to @storybook/addon-react-native-web overriding the babel config in a way that is not compatible with async functions
Describe the bug
When
@storybook/addon-react-native-web
is used,yarn build-storybook
will not show stories that contain a story with a .play function/interaction (using@storybook/addon-interactions
).There are no errors during build, but an error does appear in the console when running the built storybook:
These stories are visible when you run
yarn storybook
but not shown when you runyarn build-storybook
.Note, this is not restricted to interactions, it seems the same bug exists for any async function added as a property to the story,
i.e.
To Reproduce
https://github.com/penx/storybook-bug-play-build
yarn && yarn build-storybook && npx http-server storybook-static --port 6006
then:
yarn storybook
, these stories are still visibleyarn build-storybook --loglevel silly
produces no errors or warnings other than what is visible in the repro-baseAdditional context
Screenshot of repro storybook with "Pages" missing:
Possibly related:
The text was updated successfully, but these errors were encountered: