Fix NPM7 peer dependencies
See original GitHub issueNPM7 has changed the semantics of peer dependencies which caused NPM to fail: #12983
I updated the CLI to use --legacy-peer-deps to work around this issue: #14106
However, the underlying structure of the project has not changed, and presumably this will bite us in the future.
There are at least two kinds of dependency errors:
- Dependencies on external libraries like
@reach/routerwhich are not React17 compatible - Use of optional peer dependencies within Storybook itself, e.g.
addon-docs
External libraries
For each library that is not NPM7 compatible, we should either
- Fork it, make it compatible, issue a PR, replace the fork with the upgrade once PR is merged
- OR upgrade to an alternative
In the case of @reach/router, the path forward could be React Router which does support React 17
Internal dependencies
@storybook/addon-docs has optional peer dependencies on each of the framework packages it supports @storybook/react, @storybook/vue, etc. It should be refactored to use dependency injection so that those dependencies can be removed. In addition, the react-specific code should probably be moved into @storybook/react, which is a bigger project.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:42
- Comments:36 (18 by maintainers)

Top Related StackOverflow Question
We recently upgraded to react-router v6!!
Ok so gonna try and starat this then.