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

upgrade webpack4 to webpack5 with error #14773

Closed
wlgmy opened this issue Apr 30, 2021 · 4 comments
Closed

upgrade webpack4 to webpack5 with error #14773

wlgmy opened this issue Apr 30, 2021 · 4 comments

Comments

@wlgmy
Copy link

wlgmy commented Apr 30, 2021

Describe the bug
step1:npx sb@next upgrade --prerelease
step2: npm i -D @storybook/builder-webpack5@next
step3: add config in ./storybook/main.js
module.exports = {
core: {
builder: "webpack5",
},
};
step4: npm run storybook
then,I got this error:
Error: Compiling RuleSet failed: Unexpected property test in condition (at ruleSet[1].rules[1].resource.test: resource => {
currentResource = resource
return true
})

To Reproduce
Link to a reproduction repo that demonstrates the bug, plus instructions on how to trigger it.

System
Please paste the results of npx sb@next info here.
Environment Info:

System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i7-8557U CPU @ 1.70GHz
Binaries:
Node: 14.15.3 - ~/.nvm/versions/node/v14.15.3/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.9 - ~/.nvm/versions/node/v14.15.3/bin/npm
Browsers:
Chrome: 90.0.4430.93
Safari: 13.1.3
npmPackages:
@storybook/addon-actions: ^6.3.0-alpha.17 => 6.3.0-alpha.17
@storybook/addon-essentials: ^6.3.0-alpha.17 => 6.3.0-alpha.17
@storybook/addon-links: ^6.3.0-alpha.17 => 6.3.0-alpha.17
@storybook/addon-viewport: ^6.3.0-alpha.17 => 6.3.0-alpha.17
@storybook/builder-webpack5: ^6.3.0-alpha.17 => 6.3.0-alpha.17
@storybook/vue: ^6.3.0-alpha.17 => 6.3.0-alpha.17
npmGlobalPackages:
@storybook/cli: 6.1.11
Additional context
Add any other context about the problem here.

@shilman
Copy link
Member

shilman commented Apr 30, 2021

Do you have a repro repo you can share?

@wlgmy
Copy link
Author

wlgmy commented Jul 5, 2021

https://github.com/wlgmy/storybook_webpack5.git
I write a demo to repro this case.

@shilman
Copy link
Member

shilman commented Jul 5, 2021

@wlgmy updated migration instructions here #15482 and tested successfully in your repro

@wlgmy
Copy link
Author

wlgmy commented Jul 8, 2021

I close this issue by: npm install webpack@5 --save-dev

@wlgmy wlgmy closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants