Yarn 2 strict pnp: @storybook/components missing dependency on regenerator-runtime
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
To Reproduce Default storybook for react install in yarn 2 workspaces with strict pnp linker.
Yarn Workspaces difference is that pnp fallback forcebly disabled, same can be achieved in regular yarn package with yarn config set pnpFallbackMode none
Run yarn workspace storybook start
, build fails with:
Module not found: Error: @storybook/components tried to access regenerator-runtime, but it isnโt declared in its dependencies; this makes the require call ambiguous and unsound.
Expected behavior Storybook builds and starts dev server
Screenshots
Code snippets
Adding regenerator-runtime
as peer dependency fixes the error.
# .yarnrc.yml
packageExtensions:
"@storybook/components@6.1.17":
peerDependencies:
regenerator-runtime: ">=0.11.1"
System
$ yarn dlx sb@next info
Environment Info:
System: OS: Linux 5.10 Fedora 33 (Workstation Edition) 33 (Workstation Edition) CPU: (8) x64 Intelยฎ Coreโข i7-6700HQ CPU @ 2.60GHz Binaries: Node: 14.15.4 - /tmp/xfs-2274736b/node Yarn: 2.4.0 - /tmp/xfs-2274736b/yarn npm: 6.14.10 - /usr/bin/npm Browsers: Chrome: 88.0.4324.150 Firefox: 85.0
yarn info -A -R --dependents --virtuals @storybook/components โโ @storybook/components@npm:6.1.17 โ โโ Instances: 1 โ โโ Version: 6.1.17 โ โ โ โโ Dependents โ โ โโ @storybook/addon-actions@npm:6.1.17 โ โ โโ @storybook/addon-backgrounds@npm:6.1.17 โ โ โโ @storybook/addon-controls@npm:6.1.17 โ โ โโ @storybook/addon-docs@npm:6.1.17 โ โ โโ @storybook/addon-toolbars@npm:6.1.17 โ โ โโ @storybook/addon-viewport@npm:6.1.17 โ โ โโ @storybook/core@npm:6.1.17 โ โ โโ @storybook/ui@npm:6.1.17 โ โ โ โโ Dependencies โ โโ @popperjs/core@npm:^2.5.4 โ npm:2.6.0 โ โโ @storybook/client-logger@npm:6.1.17 โ npm:6.1.17 โ โโ @storybook/csf@npm:0.0.1 โ npm:0.0.1 โ โโ @storybook/theming@npm:6.1.17 โ npm:6.1.17 โ โโ @types/overlayscrollbars@npm:^1.9.0 โ npm:1.12.0 โ โโ @types/react-color@npm:^3.0.1 โ npm:3.0.4 โ โโ @types/react-syntax-highlighter@npm:11.0.4 โ npm:11.0.4 โ โโ core-js@npm:^3.0.1 โ npm:3.8.3 โ โโ fast-deep-equal@npm:^3.1.1 โ npm:3.1.3 โ โโ global@npm:^4.3.2 โ npm:4.4.0 โ โโ lodash@npm:^4.17.15 โ npm:4.17.20 โ โโ markdown-to-jsx@npm:^6.11.4 โ npm:6.11.4 โ โโ memoizerific@npm:^1.11.3 โ npm:1.11.3 โ โโ overlayscrollbars@npm:^1.10.2 โ npm:1.13.1 โ โโ polished@npm:^3.4.4 โ npm:3.6.7 โ โโ react-color@npm:^2.17.0 โ npm:2.19.3 โ โโ react-popper-tooltip@npm:^3.1.1 โ npm:3.1.1 โ โโ react-syntax-highlighter@npm:^13.5.0 โ npm:13.5.3 โ โโ react-textarea-autosize@npm:^8.1.1 โ npm:8.3.0 โ โโ ts-dedent@npm:^2.0.0 โ npm:2.0.0 โ โโ @storybook/components@npm:6.1.17 [22ebd] โโ Version: 6.1.17 โ โโ Dependents โ โโ @storybook/addon-actions@npm:6.1.17 [edd76] โ โโ @storybook/addon-backgrounds@npm:6.1.17 [dfc29] โ โโ @storybook/addon-controls@npm:6.1.17 [dfc29] โ โโ @storybook/addon-docs@npm:6.1.17 [edd76] โ โโ @storybook/addon-toolbars@npm:6.1.17 [dfc29] โ โโ @storybook/addon-viewport@npm:6.1.17 [dfc29] โ โโ @storybook/core@npm:6.1.17 [50077] โ โโ @storybook/ui@npm:6.1.17 [aa913] โ โโ Peer dependencies โโ @types/react-dom@* โ โ โโ @types/react@* โ โ โโ react-dom@^16.8.0 || ^17.0.0 โ npm:17.0.1 [edd76] โโ react@^16.8.0 || ^17.0.0 โ npm:17.0.1
Additional context This is general issue exposed by yarn 2 being very strict with undeclared dependencies usage.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:5 (5 by maintainers)
Top GitHub Comments
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.29 containing PR #13916 that references this issue. Upgrade today to the
@next
NPM tag to try it out!Closing this issue. Please re-open if you think thereโs still more to do.
iโm still seeing this error using yarn 2 (actually v3.0.0-rc.5, but v3 is just a continuation, rather than a massive change like v1 to v2) and storybook v6.3.0-rc.11. iโm directly depending on:
i started seeing the error in my builds after i added a
.storybook/manager.js
file with the following contents (the storybook keyboard shortcuts were interfering with testing keyboard navigation in my components):the error logs look like:
Full logs from 4 lines above ERR! to end (very repetitive but in case itโs helpful)