storybook stories fail if component is imported from shared library
See original GitHub issueI am trying to import a component from a shared library into storybook, but this is failing.
i see this error message about not being able to resolve the path to the module:
src/general/inputs/formik-phone-field/FormikPhoneField.tsx ERR! Line 1:25: Unable to resolve path to module '@coast-workspace/general' import/no-unresolved
`❯ npx nx report
NX Report complete - copy this into the issue template
Node : 18.7.0 OS : darwin arm64 yarn : 1.22.19
nx : 14.5.4 @nrwl/angular : Not Found @nrwl/cypress : 14.5.4 @nrwl/detox : Not Found @nrwl/devkit : 14.5.4 @nrwl/eslint-plugin-nx : 14.5.4 @nrwl/express : Not Found @nrwl/jest : 14.5.4 @nrwl/js : 14.5.4 @nrwl/linter : 14.5.4 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : 14.5.2 @nrwl/nx-plugin : Not Found @nrwl/react : 14.5.4 @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.5.10 @nrwl/web : 14.5.4 @nrwl/workspace : 14.5.4 typescript : 4.5.5
Community plugins:`
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
React storybook: issue importing from other libraries - nrwl/nx
Storybook doesn't allow importing from another internal library or allow code that imports from another library. Failure Information (for bugs).
Read more >Import stories in tests - Storybook - JS.ORG
Once the test runs, it loads the story and renders it. Testing Library then emulates the user's behavior and checks if the component...
Read more >How to troubleshoot storybook not loading stories?
Resave save the story file. It makes the component reappear in side panel, and then you can see the errors. start-storybook seems to...
Read more >How to Import Your Components to Storybook and Use Them ...
Designing with Storybook components is easy! But how to bring them to Storybook at first? Read our walk-through!
Read more >Build a component library with React and TypeScript
Next, we can create the story for the input component: import React from 'react'; ...
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 FreeTop 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
Top GitHub Comments
Hey @peter-coastpay-com , it may be unrelated, but some of your @nrwl/* packages don’t line up with the version of
nx
you have installed. Aside from@nrwl/nx-cloud
, all packages under the nrwl scope should generally be set up with the same version.Can you correct this and check that the issue still reproduces? An easy way to fix this would be to run
nx migrate 14.5.10
. Alternatively, you could downgrade @nrwl/storybook to 14.5.4Ohhh I see. I’m so glad you managed to solve this issue! 😃