React storybook: issue importing from other libraries
See original GitHub issueExpected Behavior
When used with storybook it should be possible to import from other internal libraries.
Current Behavior
Storybook doesn’t allow importing from another internal library or allow code that imports from another library.
Failure Information (for bugs)
Library A has storybook configured. This will work fine if the library has no dependencies on another internal library, however it will fail if another internal library is referenced either in the story or code that the story references.
Steps to Reproduce
- Create a react library
- Add storybook configuration to it
- Add a dependency on another internal lib
Context
Please provide any relevant information about your setup:
@nrwl/angular : Not Found
@nrwl/cli : 8.11.1
@nrwl/cypress : 8.11.1
@nrwl/eslint-plugin-nx : 8.11.1
@nrwl/express : Not Found
@nrwl/jest : 8.11.1
@nrwl/linter : 8.11.1
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : 8.11.1
@nrwl/schematics : Not Found
@nrwl/tao : 8.11.1
@nrwl/web : 8.11.1
@nrwl/workspace : 8.11.1
typescript : 3.5.3
Failure Logs
Output from storybook:
ERROR in ./libs/core/src/lib/core.tsx
Module not found: Error: Can't resolve '@storybook-issue/hello-world' in 'User\Documents\Github\storybook-issue\libs\core\src\lib'
@ ./libs/core/src/lib/core.tsx 3:0-58 10:43-53
@ ./libs/core/src/lib/core.stories.tsx
@ ./libs/core/src/lib sync \.stories\.tsx?$
@ ./libs/core/.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./libs/core/.storybook/config.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true
Other
I’ve recreated the bug here: https://github.com/allforabit/storybook-issue
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Importing a component library using react in Storybook
I have two projects: one is a component library called simply '@loonslanding/components'. The other is a storybook project.
Read more >How to Import Your Components to Storybook and Use Them ...
UXPin Merge users – Import your public or private Storybook Library as live React components, where you can make functionally prototypes ...
Read more >Distribute UI across an organization - Storybook Tutorials
This chapter walks through design system distribution from packaging UI components to importing them into other apps. We'll also uncover time-saving ...
Read more >How to Create and Publish a React Component Library
To get it running with Storybook is a different matter however. Note that this is the main reason we used the --builder webpack5...
Read more >@storybook/react-native - npm
In the getting started guide we suggest that you override you change the default export to be the storybook UI, this might not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Adding
tsconfig-paths-webpack-plugin
seems to fix it:here’s how my webpack.config.js looks like