-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Compatibility issues with Storybook 6 #2718
Comments
Moving this issue over to the main |
Just checked and could reproduce the error. It's resolved by removing the npm aliases. They've always been a bit buggy in our experience, so I'd avoid them for now and just rely on webpack aliasing. Removing the npm aliases resolves the issue 👍 |
Aha, I was expecting the entire storybook to render through Preact rather than just the inside iframe. Looking at the sources tab of the iframe, I can see that preact is indeed rendering the content rather than react. So if anyone runs into a similar issue, aliasing is indeed not required. The app within the storybook does indeed render through preact without any special configuration needed! 👍 |
@vattenapa How do you manage Preact/compat to work with Storybook ? |
I have a project using Next.js + Preact (based off the using-preact example.
I'm currently trying to set up storybook in the project, when I installed it initially @ version 6.0.10, everything worked hunky dory. But if I try to update my storybook packages to the latest version, the entire storybook application breaks. The console looks something like this:
I found an issue in the storybook project, where the error has been discussed and somewhat solved for React users. TL;DR, the problem appears when multiple versions of react are being loaded.
running
yarn why react
has the following output:So, all my storybook components are using the same version of react. The proposed solution is to set up resolutions in package.json, pinning
react
andreact-dom
to specific versions. Setting up resolutions to use preact-compat:works as expected when installing.
yarn why react
:But this leads to a different error:
And here is where I'm stuck. I don't know if the issue is my setup, something in preact-compat or in storybook. Probably the first.
I'm sorry if this comes across as a general question rather than a bug report, but my node skills aren't quite there to try and figure this out further. I'm just dumping whatever I have figured out so maybe someone smarter than me can point me in the right direction.
Am I misunderstanding how to handle the resolutions? Is my package.json breaking something important? (If I don't specify
react
underdependencies
, storybook just uses it's ownreact
dependency.)Here is a sandbox with a minimal example to reproduce (without
resolutions
).The text was updated successfully, but these errors were encountered: