storybookjs / addon-react-native-web

Build react-native-web projects in Storybook for React
MIT License
83 stars 24 forks source link

[Bug] `7.6.0` issue `ReferenceError: exports is not defined` #75

Closed mkmakes closed 11 months ago

mkmakes commented 11 months ago

Describe the bug

Hello! 👋 The recently released 7.6.0 seems to break integration with this addon, with previews displaying the following error: ReferenceError: exports is not defined

Steps to reproduce the behavior

  1. Clone reproduction repository

Expected behavior

  1. Switch to branch 7.5.3-working
  2. yarn && yarn storybook
  3. React Native Web component and story compiles and shows in storybook preview
image

Screenshots and/or logs

  1. Switch to branch 7.6.0-broken
  2. rm -rf node_modules && yarn && yarn storybook
  3. React Native Web component and story compiles, but preview errors with: ReferenceError: exports is not defined
image

Environment

dannyhw commented 11 months ago

@mkmakes have you tried with 7.6.3? Seems like an upstream issue that has been resolved in recent patches.

If it still doesn't work then please provide a reproduction so i can investigate further. Thanks 🙏.

mkmakes commented 11 months ago

@mkmakes have you tried with 7.6.3? Seems like an upstream issue that has been resolved in recent patches.

If it still doesn't work then please provide a reproduction so i can investigate further. Thanks 🙏.

For sure! I checked out 7.6.3 and the problem still persists. Here's 7.6.3-broken with the reproduction

dannyhw commented 11 months ago

I'm travelling right now so its hard for me to investigate right now but once I'm back i will take a look. I recommend staying on 7.5 for now if it's blocking you.

mkmakes commented 11 months ago

I updated my monorepo to 7.6.4 and it seems to work now!

adamhari commented 11 months ago

I updated my monorepo to 7.6.4 and it seems to work now!

Strange, this is still happening for me, even with the example project.

Opened another issue for this.