-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
ModuleNotFoundError @storybook/addon-docs NPM 7 #14429
Comments
having this same problem |
have you solved the problem ? |
Please add |
I was getting this error and I realised that @storybook/addon-docs wasn't in package.json, I think it might have been part of addon-essentials and isn't anymore or something like that, very odd. |
The issue is that NPM7 has changed the semantics of how dependencies work compared to previous versions of NPM. NPM6:
NPM7:
|
Let me share my case. Might be other factor made this situation since I kinda have complicated repo. NPM8 (+ npm workspace + npm-force-resolutions):
|
@shilman Is there a proposed solution for NPM 8? I've pulled all storybook dependencies into a separate NPM project and listed
However, NPM 8 installs this in the packages node_modules. i.e. On the other hand, if I install |
@josh-biddick we'll need to address the package structure in a future release. any suggestions? we're still trying to catch up with NPM7 -- haven't even looked at NPM8 yet |
@shilman I'm not sure I have enough knowledge about the Node resolution strategy to comment but to reproduce I would potentially try to emulate a scenario where you have a separate package containing the Storybook dependencies and install that package as a dependency in your root project. Later, attempt to run As for solving the issue, maybe the Node resolution strategy has changed significantly and there maybe someone here who has a deeper understanding as to why this problem occurs? We have other projects that use other packages to provide common dependencies, so I'm actually less inclined to think it has to do with NPM and more to do with Webpack (https://webpack.js.org/concepts/module-resolution/) |
@josh-biddick did you end up uncovering any potential solutions to this other than the workaround you mentioned here? I'm running into exactly the same issue in a project of mine. |
@lwpulsifer No nothing yet. |
@storybook/addon-docs storybookjs/storybook#14429
Was running into the same exact problem, this did the trick. Weird workaround though. |
I fixed this exact same error by removing the following lines from storybook/addons.js: |
Is this mentioned somewhere in npm 7 release notes somewhere, would want to understand this a little better |
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
|
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
Code snippets
If applicable, add code samples to help explain your problem.
System
The text was updated successfully, but these errors were encountered: