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

Broken React 17 support in v13.1.0 #2127

Open
SevereCloud opened this issue Feb 14, 2023 · 4 comments
Open

Broken React 17 support in v13.1.0 #2127

SevereCloud opened this issue Feb 14, 2023 · 4 comments

Comments

@SevereCloud
Copy link

Current behavior

Broken support React 17 in v13.1.0

To reproduce

VKCOM/VKUI#4225

Building style guide...
 FAIL  Failed to compile

Module not found: Error: Can't resolve 'react-dom/client' in '/home/runner/work/VKUI/VKUI/node_modules/react-styleguidist/lib/client'
Module not found: Error: Can't resolve 'react-dom/client' in '/home/runner/work/VKUI/VKUI/node_modules/react-styleguidist/lib/client/rsg-components/Preview'
error Command failed with exit code 1.

Expected behavior

@malcolm-kee
Copy link
Contributor

Depends on the goal of the maintainer, I do think it's possible to support both by adding extra complexity on build time.

A dirty hack that I did on unrelated project is to read the ReactDOM version on build time, and generate a compat virtual module like this:

https://github.com/malcolm-kee/react-showroom/blob/e957135fb07f1adfe49192f3f19fef12c902f04f/packages/react-showroom/src/lib/generate-showroom-data.ts#L554-L606

@ThomasRoest
Copy link
Collaborator

ThomasRoest commented Feb 14, 2023

yes this should have been a new major version. Sorry about that, you can lock it to 13.0.0. I don't have time / plans to support both 17 & 18

@shaddamalbz
Copy link

shaddamalbz commented May 3, 2023

I have same issue in version 16, what version should I use?

@alexander-schranz
Copy link

alexander-schranz commented Mar 25, 2024

For all stumble over this you can use:

"react-styleguidist": "~13.0.0",

which is same as:

"react-styleguidist": "13.0.*",

To keep it the 13.0 version which has React 17 support.

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

No branches or pull requests

5 participants