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

CLI: Fix addons register in RN template #18693

Merged
merged 1 commit into from Jul 14, 2022
Merged

Conversation

jsflor
Copy link
Contributor

@jsflor jsflor commented Jul 12, 2022

Issue: #18692

Fix Module not found: Can't resolve '@storybook/addon-ondevice-actions/manager' error after installing storybook on react native expo app (npx -p @storybook/cli sb init --type react_native)

Issue:
Getting module not found error when trying to run storybook in react native expo app

./storybook/rn-addons.js:1
Module not found: Can't resolve '@storybook/addon-ondevice-actions/manager'
> 1 | import '@storybook/addon-ondevice-actions/manager';
  2 | import '@storybook/addon-ondevice-knobs/manager';
  3 |
./storybook/rn-addons.js:2
Module not found: Can't resolve '@storybook/addon-ondevice-knobs/manager'
  1 | import '@storybook/addon-ondevice-actions/manager';
> 2 | import '@storybook/addon-ondevice-knobs/manager';
  3 |

What I did

Changed these two imports to point to /register instead of /manager:

  1. import '@storybook/addon-ondevice-actions/manager';
  2. import '@storybook/addon-ondevice-knobs/manager';

How to test

Follow the steps depicted in Storybook get started:

expo init --template tabs@sdk-36 taskbox (Create new empty expo project)

cd taskbox

npx -p @storybook/cli sb init --type react_native (Add storybook support)

export {default} from './storybook'; (Export default from entrypoint of your app)

After setting up the project if you try to run storybook it will not crash as before

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

Fix Module not found: Can't resolve '@storybook/addon-ondevice-actions/manager' error after installing storybook on react native expo app (npx -p @storybook/cli sb init --type react_native)

Closes storybookjs#18692
@nx-cloud
Copy link

nx-cloud bot commented Jul 12, 2022

☁️ Nx Cloud Report

We didn't find any information for the current pull request with the commit 4c944f7.
You might need to set the 'NX_BRANCH' environment variable in your CI pipeline.

Check the Nx Cloud Github Integration documentation for more information.


Sent with 💌 from NxCloud.

Copy link
Member

@shilman shilman left a comment

LGTM! Sorry about that!

@shilman shilman added bug cli patch Bugfix & documentation PR that need to be picked to master branch labels Jul 14, 2022
@shilman shilman changed the title Update rn-addons.js: rename /manager to /register #18692 CLI: Fix addons register in RN template Jul 14, 2022
@shilman shilman merged commit c803300 into storybookjs:next Jul 14, 2022
20 checks passed
@dannyhw
Copy link

dannyhw commented Jul 14, 2022

Hey @shilman, can we get this cherry picked to the latest cli version? 🙏

@shilman
Copy link
Member

shilman commented Jul 15, 2022

Absolutely. Next few days

@dannyhw
Copy link

dannyhw commented Jul 15, 2022

awesome! thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli patch Bugfix & documentation PR that need to be picked to master branch picked Patch/release PRs cherry-picked to master/release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants