question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

storybook stories fail if component is imported from shared library

See original GitHub issue

I 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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AgentEndercommented, Aug 26, 2022

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.4

0reactions
mandarinicommented, Sep 8, 2022

Ohhh I see. I’m so glad you managed to solve this issue! 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found