storybook: FAST_REFRESH=true causes compilation error (Webpack 5 support)
Describe the bug FAST_REFRESH=true causes compilation error. Same as if I would configure .storybook/main.js or add plugin manually into config.plugins.
To Reproduce Steps to reproduce the behavior:
- Default config
FAST_REFRESH=true start-storybook
The same project builds successfully with webpack & @pmmmwh/react-refresh-webpack-plugin. The same storybook compiles without FAST_REFRESH=true
yarn run v1.22.10
$ FAST_REFRESH=true start-storybook
info @storybook/react v6.1.15
info => Using prebuilt manager
info => Loading presets
info => Loading 1 config file in "./.storybook"
info => Loading 7 other files in "./.storybook"
info => Adding stories defined in ".storybook/main.js"
info => Using React fast refresh
info => Using default Webpack setup
0% compilingERR! TypeError: Cannot read property 'tap' of undefined
ERR! at /Users/dan/github/project/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/index.js:236:65
Expected behavior Succesful compilation
System
Environment Info:
System:
OS: macOS 11.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 13.8.0 - ~/.nvm/versions/node/v13.8.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v13.8.0/bin/yarn
npm: 6.13.6 - ~/.nvm/versions/node/v13.8.0/bin/npm
Browsers:
Chrome: 88.0.4324.96
Firefox: 84.0.2
Safari: 14.0.2
npmPackages:
@storybook/addon-actions: ^6.1.15 => 6.1.15
@storybook/addon-essentials: ^6.1.15 => 6.1.15
@storybook/addon-links: ^6.1.15 => 6.1.15
@storybook/react: ^6.1.15 => 6.1.15
Packages:
"react-refresh": "^0.9.0",
"webpack": "^5.18.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 21 (7 by maintainers)
@timkindberg going to beta this week, final in about a month (knock wood)
@shilman It works for us too with
6.4.0-alpha.25, many thanks!@shilman Yes, it works now (having
6.4.0-alpha.22), thank you for letting us know.I’m seeing this problem too (“no longer a waterfall hook, but a bailing hook instead”) – it does indeed look like a new problem, recently appearing. I see some deprecation warnings before, which I don’t know if they are relevant:
@dcwarwick perhaps there’s a regression in #15399? if you could open a new issue with a reproduction that would be really helpful https://storybook.js.org/docs/react/contribute/how-to-reproduce
Try upgrading to the latest prerelease:
Does that fix it? It contains this PR that’s supposed to fix it: https://github.com/storybookjs/storybook/pull/15616