-
-
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
[Bug]: @storybook/addon-storyshots is not compatible with react 18 #19541
Comments
The @shilman It would be great to get this change released on 6.x, I'm not terribly happy about having storyshot deps on an unstable version while all the other storybook deps are on 6.x |
@KorySchneider pretty sure that would be a breaking change. any idea why the resolutions workaround didn't work? |
@shilman Ah I see. Not sure why the resolutions didn't work...I'm using pnpm so potentially a bug with that? |
@KorySchneider did you try overrides? https://pnpm.io/package_json#pnpmoverrides |
@shilman Yep that's what I used.
and
|
Have you checked in your node_modules the package version of
react-test-renderer to see if the overrides/resolutions were respected ?
Le lun. 24 oct. 2022, 16:08, Kory Schneider ***@***.***> a
écrit :
… @shilman <https://github.com/shilman> Yep that's what I used. resolutions
is just an alias for overrides. I tried it two ways:
"overrides": {
"react-test-renderer": "18.2.0"
}
and
"overrides": {
***@***.***/addon-storyshots>react-test-renderer": "18.2.0"
}
—
Reply to this email directly, view it on GitHub
<#19541 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABY45AWULJIGW2SNZ64Q4U3WE2J55ANCNFSM6AAAAAARJDTE2Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@barroudjo I believe I did but I'll try it again soon and see what I see. What I do remember is that in the logs, the TypeError was coming from |
This solution fixed my problem. "overrides": { steps
|
Yeah my bad, my solution with |
The Storyshots addon is officially deprecated and will be removed in a future release of Storybook. To help with the transition process, we've created a migration guide for the available options and common use cases. |
Describe the bug
storyshots with react v18 throws
react-test-renderer TypeError: Cannot read properties of undefined
This is due to @storybook/[email protected] having the following dependency for react-test-renderer:
^16.8.0 || ^17.0.0
which is incompatible with react v18.Using resolutions in package.json solves the problem, but it should really be solved in @storybook/addon-storyshots dependencies by allowing react-test-renderer@18.
"resolutions": { "react-test-renderer": "18.2.0" }
To Reproduce
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: