Skip to content
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

[Bug]: Broken React 18 peer dependency when installing sb@next having old(?) @storybook/blocks 7.0.0-alpha.8 with outdated @mdx-js/react version #21396

Closed
D1no opened this issue Mar 4, 2023 · 5 comments

Comments

@D1no
Copy link

D1no commented Mar 4, 2023

Describe the bug

Just installed the latest storybook 7 version in our pnpm monorepo, where react 18.2 is global and got the following. Not sure why @mdx-js/react is at version 1.6.22 in SB <-> while the latest release of mdx is 2.3.0 at time of writing (?)

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

_tooling/storybook
└─┬ @storybook/blocks 7.0.0-alpha.8
  └─┬ @mdx-js/react 1.6.22
    └── ✕ unmet peer react@"^16.13.1 || ^17.0.0": found 18.2.0

To Reproduce

Using pnpm@7.28.0 (latest stable) though this dependency problem is package manager unrelated.

Strict Peer Dependencies

Create .npmrc file with

strict-peer-dependencies = true

Add React 18 to empty project

pnpm install react

Init Storybook

pnpx storybook@next init --builder vite

Result during install

_tooling/storybook
└─┬ @storybook/blocks 7.0.0-alpha.8
  └─┬ @mdx-js/react 1.6.22
    └── ✕ unmet peer react@"^16.13.1 || ^17.0.0": found 18.2.0

hint: If you don't want pnpm to fail on peer dependency issues,
add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.

System

Environment Info:

  System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.14.1 - ~/.nvs/default/bin/node
    npm: 9.3.1 - ~/.nvs/default/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Firefox: 97.0.1
    Safari: 16.3
  npmPackages:
    @storybook/addon-essentials: ^7.0.0-beta.61 => 7.0.0-beta.61 
    @storybook/addon-interactions: ^7.0.0-beta.61 => 7.0.0-beta.61 
    @storybook/addon-links: ^7.0.0-beta.61 => 7.0.0-beta.61 
    @storybook/blocks: ^7.0.0-alpha.8 => 7.0.0-alpha.8 
    @storybook/react: ^7.0.0-beta.61 => 7.0.0-beta.61 
    @storybook/react-vite: ^7.0.0-beta.61 => 7.0.0-beta.61 
    @storybook/testing-library: ^0.0.14-next.1 => 0.0.14-next.1

Additional context

In #20260 and #14119 it was said that mdx was updated in december (?)

@D1no
Copy link
Author

D1no commented Mar 4, 2023

Here in git on the next branch, @storybook/blocks is at version 7.0.0-beta.60. No idea why a fresh SB install today uses version 7.0.0-alpha.8. Maybe a project publishing issue? 🤷🏻‍♂️🤷🏻‍♂️

"name": "@storybook/blocks",
"version": "7.0.0-beta.60",

@D1no D1no changed the title [Bug]: Broken React 18 peer dependency due to old @mdx-js/react version in @storybook/blocks 7.0.0-alpha.8 [Bug]: Broken React 18 peer dependency in fresh SB next install due to old @mdx-js/react version via @storybook/blocks 7.0.0-alpha.8 Mar 4, 2023
@D1no D1no changed the title [Bug]: Broken React 18 peer dependency in fresh SB next install due to old @mdx-js/react version via @storybook/blocks 7.0.0-alpha.8 [Bug]: Broken React 18 peer dependency when installing sb@next via old(?) @storybook/blocks 7.0.0-alpha.8 with outdated @mdx-js/react version Mar 4, 2023
@D1no D1no changed the title [Bug]: Broken React 18 peer dependency when installing sb@next via old(?) @storybook/blocks 7.0.0-alpha.8 with outdated @mdx-js/react version [Bug]: Broken React 18 peer dependency when installing sb@next having old(?) @storybook/blocks 7.0.0-alpha.8 with outdated @mdx-js/react version Mar 4, 2023
@D1no
Copy link
Author

D1no commented Mar 4, 2023

Also after installing storybook, depreciated warning for stable@0.1.8:

_tooling/storybook                       |  WARN  deprecated stable@0.1.8

@ndelangen
Copy link
Member

I suspect it might be a lockfile issue @D1no, try regenerating it?

@D1no
Copy link
Author

D1no commented Mar 6, 2023

No, it's a fresh install. Also shows up in the (unrelated) storybook reproduction -

D1no/reproduction-storybook-symlinks-pnpm@92eee47

@D1no
Copy link
Author

D1no commented Mar 6, 2023

Closing this, as with storybook@7.0.0-beta.62 seems to correctly reference @storybook/blocks@7.0.0-beta.62 and no longer throws the reported warning! 👏

See
D1no/reproduction-storybook-symlinks-pnpm@5f71f59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants