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

[3.0.0] Using React Native storybooks does not add react-dom #1112

Closed
orta opened this issue May 24, 2017 · 1 comment
Closed

[3.0.0] Using React Native storybooks does not add react-dom #1112

orta opened this issue May 24, 2017 · 1 comment

Comments

@orta
Copy link
Member

orta commented May 24, 2017

Hello there, I thought I'd take a look at updating our React Native usage of storybooks from ~2.3.0 to 3.0.0

I removed the kadira version, then added the new storybooks:

yarn remove @kadira/react-native-storybook
yarn add  @storybook/react-native -D

Edited my source code to fix import names, improve my web pack config then launched: artsy/emission@4846716


When I started up the storybooks server, I got: Error: Can't resolve 'react-dom' in '/Users/orta/dev/projects/artsy/ios/emission/node_modules/@storybook/ui/dist/modules/ui'

[0] React packager ready.
[0]
[0] Loading dependency graph, done.
[1] webpack built ba4837d5356e0a9bdd29 in 5036ms
[1] Hash: ba4837d5356e0a9bdd29
[1] Version: webpack 2.6.0
[1] Time: 5036ms
[1]                    Asset     Size  Chunks                    Chunk Names
[1] static/manager.bundle.js  3.19 MB       0  [emitted]  [big]  manager
[1] chunk    {0} static/manager.bundle.js (manager) 1.13 MB [entry] [rendered]
[1]     [0] ./~/react/react.js 56 bytes {0} [built]
[1]    [10] ./~/babel-runtime/core-js/object/get-prototype-of.js 104 bytes {0} [built]
[1]    [85] ./~/@storybook/ui/dist/index.js 2.42 kB {0} [built]
[1]   [128] ./~/@storybook/react-native/dist/manager/index.js 437 bytes {0} [built]
[1]   [129] ./~/@storybook/react-native/dist/server/addons.js 484 bytes {0} [built]
[1]   [135] ./~/@storybook/addon-actions/register.js 30 bytes {0} [built]
[1]   [138] ./~/@storybook/addon-links/register.js 30 bytes {0} [built]
[1]   [146] ./~/@storybook/react-native/dist/manager/provider.js 3.69 kB {0} [built]
[1]   [150] ./~/@storybook/ui/dist/modules/api/index.js 759 bytes {0} [built]
[1]   [153] ./~/@storybook/ui/dist/modules/shortcuts/index.js 509 bytes {0} [built]
[1]   [175] ./~/@storybook/ui/dist/modules/ui/index.js 1.01 kB {0} [built]
[1]   [253] ./~/mantra-core/index.js 41 bytes {0} [built]
[1]   [261] ./~/podda/dist/index.js 4.16 kB {0} [built]
[1]   [345] ./~/util-deprecate/browser.js 1.61 kB {0} [built]
[1]   [351] multi ./~/@storybook/react-native/dist/server/addons.js ./~/@storybook/react-native/dist/manager/index.js 40 bytes {0} [built]
[1]      + 337 hidden modules
[1]
[1] ERROR in ./~/@storybook/ui/dist/modules/ui/routes.js
[1] Module not found: Error: Can't resolve 'react-dom' in '/Users/orta/dev/projects/artsy/ios/emission/node_modules/@storybook/ui/dist/modules/ui'
[1]  @ ./~/@storybook/ui/dist/modules/ui/routes.js 43:16-36
[1]  @ ./~/@storybook/ui/dist/modules/ui/index.js
[1]  @ ./~/@storybook/ui/dist/index.js
[1]  @ ./~/@storybook/react-native/dist/manager/index.js
[1]  @ multi ./~/@storybook/react-native/dist/server/addons.js ./~/@storybook/react-native/dist/manager/index.js
[1]
[1] ERROR in ./~/react-modal/lib/components/Modal.js
[1] Module not found: Error: Can't resolve 'react-dom' in '/Users/orta/dev/projects/artsy/ios/emission/node_modules/react-modal/lib/components'
[1]  @ ./~/react-modal/lib/components/Modal.js 2:15-35 9:33-53
[1]  @ ./~/react-modal/lib/index.js
[1]  @ ./~/@storybook/ui/dist/modules/ui/components/shortcuts_help.js
[1]  @ ./~/@storybook/ui/dist/modules/ui/containers/shortcuts_help.js
[1]  @ ./~/@storybook/ui/dist/modules/ui/routes.js
[1]  @ ./~/@storybook/ui/dist/modules/ui/index.js
[1]  @ ./~/@storybook/ui/dist/index.js
[1]  @ ./~/@storybook/react-native/dist/manager/index.js
[1]  @ multi ./~/@storybook/react-native/dist/server/addons.js ./~/@storybook/react-native/dist/manager/index.js

This was easily fixed for my project by doing yarn add react-dom -D but I think you'll need to declare this somewhere for React Native projects 👍

@shilman
Copy link
Member

shilman commented May 24, 2017

@orta please upgrade to the latest alpha. this has been fixed. closing for now, but please feel free to reopen if you find differently.

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

2 participants