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.

ModuleNotFoundError @storybook/addon-docs NPM 7

See original GitHub issue

Describe the bug Can't resolve '@storybook/addon-docs/blocks' in '/Users/me/myproject/path/to/stories'. I can’t import addon-docs from my stories, after I upgraded to storybook 6.2.1 (from 6.1.17). I have addon-essentials installed.

I suspect this has something to do with incompatibility issues with NPM 7 workspaces. I get this error in a subpackage from a worspace set-up.

A workaround is to install addon-docs explicitly instead of just addon-essentials. But afaik that’s should not be the case, since not even sb init installs it explicitly.

To Reproduce Install Storybook version 6.2.1 inside a subpackage of an NPM 7 workspaces and try importing something from addon-docs inside an MDX story.

Screenshots Screenshot 2021-04-01 at 10 04 08

Code snippets If applicable, add code samples to help explain your problem.

System

Environment Info:

  System:
    OS: macOS 11.2.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 15.8.0 - ~/.nvm/versions/node/v15.8.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.4/bin/yarn
    npm: 7.6.3 - ~/.nvm/versions/node/v15.8.0/bin/npm
  Browsers:
    Chrome: 89.0.4389.114
    Edge: 89.0.774.63
    Firefox: 86.0
    Safari: 14.0.3

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:16
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
cauediademicommented, Jul 19, 2022

I fixed this exact same error by removing the following lines from storybook/addons.js: import ‘@storybook/addon-actions/manager’; import ‘@storybook/addon-knobs/manager’; import ‘@storybook/addon-links/manager’;

2reactions
shilmancommented, Oct 18, 2021

Please add @storybook/addon-docs as a project dependency

Read more comments on GitHub >

github_iconTop Results From Across the Web

storybook/addon-docs - npm
DocsPage is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, ...
Read more >
Storybook ERROR. Module not found: Error: Can't resolve ...
Try to delete the package-lock.json file and the node_modules and re-install the dependancies. This might cause by corrupted node modules.
Read more >
Install addons - Storybook
Storybook has hundreds of reusable addons that are packaged as NPM modules. Let's walk through how to extend Storybook by installing and registering...
Read more >
How to resolve a path alias in Storybook - +return
Module not found: Error : Can't resolve ... node_modules/@storybook/addon-docs/dist/esm/frameworks/react/config.js-generated-config-entry.js ...
Read more >
Storybook-addon-next - npm.io
See Documentation for more details on how the supported features work in this addon. If something doesn't work as you would expect, feel...
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