Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve "@storybook/core/manager-api" #628

Open
pvinis opened this issue Oct 22, 2024 · 4 comments
Open

Unable to resolve "@storybook/core/manager-api" #628

pvinis opened this issue Oct 22, 2024 · 4 comments

Comments

@pvinis
Copy link
Contributor

pvinis commented Oct 22, 2024

Describe the bug
I am trying to add storybook on an expo 51 project with expo-router.

To Reproduce
Steps to reproduce the behavior:

  1. I have added the withStorybook in metro.config.js
  2. I have added the require().default bit on my index.tsx
  3. When I start without the storybook_enabled envvar, I get this error:
Unable to resolve "@storybook/core/manager-api"

I'll try to make a repro tomorrow, with 8.3.10.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Image

Code snippets
If applicable, add code samples to help explain your problem.

System:
Please paste the results of npx -p @storybook/cli@next sb info here.

Additional context
Add any other context about the problem here.

@dannyhw
Copy link
Member

dannyhw commented Oct 22, 2024

Can you make sure that when storybook enabled is false that storybook isnt being loaded by app code (conditionally require it when enabled is true)

You can also try onDisabledRemoveStorybook set to true on the latest version.

Lastly clearing cache can sometimes be required after changing env variables

Alternatively change package exports to true in metro config

@alvinlal
Copy link

alvinlal commented Oct 25, 2024

Can you make sure that when storybook enabled is false that storybook isnt being loaded by app code (conditionally require it when enabled is true)

You can also try onDisabledRemoveStorybook set to true on the latest version.

Lastly clearing cache can sometimes be required after changing env variables

Alternatively change package exports to true in metro config

@dannyhw i am also facing the same issue,

  1. made sure storybook isn't being loaded by app code ✅
  2. where to set onDisabledRemoveStorybook to true ? 🤔
  3. tried clearing cache ✅
  4. can't see a metro config since i am using expo 🤔

thanks

@dannyhw
Copy link
Member

dannyhw commented Oct 25, 2024

You need to create a metro config file its required in the setup (see readme).

npx expo customize metro.config.js

See getting started

https://github.com/storybookjs/react-native#getting-started

@alvinlal
Copy link

You need to create a metro config file its required in the setup (see readme).

npx expo customize metro.config.js

See getting started

https://github.com/storybookjs/react-native#getting-started

thanks @dannyhw , i got it working perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants