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
TypeError: Cannot read property 'createSnapshot' of undefined #13332
Comments
I have this error too... apparently when "html-webpack-plugin" is installed, storybook doesn't start. I removed it and storybook works fine. It also conflicts with react-refresh-webpack-plugin. Maybe storybook doesn't play nice when any webpack plugin is installed on its own |
Looks like you are using something from webpack5, which is not yet supported by Storybook. Closing as dupe to #9216 |
@shilman @jimmyandrade @ckwong90 For this issue in particular, you can install the Webpack 5 compatible version of the problem plugin:
See https://github.com/jantimon/html-webpack-plugin. It's an alpha version, but Storybook builds fine after doing so. |
I'm experiencing this after a fresh |
@jeffgaynorspok tranks. I tried this, but I got the following:
|
@jimmyandrade Have your tried trashing your node_modules and package-lock.json, then run What version of |
FWIW this is now the npm i --save-dev html-webpack-plugin |
What up! While on the I checked out But trying I tried to play around using previous package versions, but no progress. |
@shaktals try running npm with |
@shilman worked like a charm, thanks man! |
I had webpack installed with version definition
After that i found this thread, so i found out that |
FYI I ran a completely fresh storybook install just now and encountered this same problem (@storybook/react": "^6.1.21"). To fix the problem I had to explicitly install |
- Run `npx -p @storybook/cli sb init --type react` - Moved .storybook and stories folders into client - Run `npm i --save-dev html-webpack-plugin@latest` to workaround storybookjs/storybook#13332 - Add storybook-static to .gitignore
- Run `npx -p @storybook/cli sb init --type react --builder webpack5` - Moved .storybook and stories folders into client - Run `npm i --save-dev html-webpack-plugin@latest` to workaround storybookjs/storybook#13332 - Add storybook-static to .gitignore
- Run `npx -p @storybook/cli sb init --type react --builder webpack5` - Moved .storybook and stories folders into client - Run `npm i --save-dev html-webpack-plugin@latest` to workaround storybookjs/storybook#13332 - Add storybook-static to .gitignore
- Run `npx -p @storybook/cli sb init --type react --builder webpack5` - Moved .storybook and stories folders into client - Run `npm i --save-dev html-webpack-plugin@latest` to workaround storybookjs/storybook#13332 - Add storybook-static to .gitignore
css-loader is no longer needed html-webpack-plugin seems to be necessary since webpack 5 storybookjs/storybook#13332 (comment)
Works perfectly fine for me. I've realized that each time that a function or variable is not reading properly, means itself the following: "Update that module please." Thanks again. |
Just encountered this as well from bumping from |
Just encountered this after updating from 6.4.10 to 6.4.19. This bug should be fixed on Storybook's end. This is not a configuration problem on our ends, as far as I can tell. Here's why:
This fixes the problem, right? Wrong. It works around the problem. When I now delete the dependency from my This is proof that the problem is in Storybook, because after this excercise, my config is identical to before the workaround. Sure, my Long story short, @shilman, if this package |
Yes, this fixed my issue and I was able to launch storybook again. Thanks |
I seem to be having the same issue too on Only thing that I can think of is that I'm using a monorepo, but I'm not totally confident that's the issue. |
Ok. I think I might have fixed it... What I've done is pinned the dependencies for any For reference, my current versions are:
|
LOL i tried your solution and it didn't work but when i reinstall html-webpack-plugin it works! i think that it's weird because 5 minutes ago i did the npm i |
When I start storybook, I got
TypeError: Cannot read property 'createSnapshot' of undefined
error.I tried to fix this:
@storybook/addon-docs
and@storybook/react
version6.1.3
. Didn't work;@storybook/addon-docs
and@storybook/react
version6.1.9
. Didn't work;To Reproduce
Working with https://github.com/FacioCode/design/tree/main/packages/react-storybook
packages/react-storybook
, runnpm start
Expected behavior
No errors should appear.
System
When I ran
npm ls webpack
with6.1.3
, I got this:The text was updated successfully, but these errors were encountered: