CRA-将反应录制升级到5.0.1 Breaks Storybook

发布于 2025-01-28 01:06:30 字数 776 浏览 2 评论 0原文

在我的CRA中,我正在使用Storybook 6.4.22版本,我正在使用React-Scripts v 4.0.3,并且已更改为5.0.1版本,但是这打破了故事书。

根据指令,我做过npx sb@next automigrate,但现在我得到了错误:

ERR! ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
ERR!  - configuration.module.rules[4] should be one of these:
ERR!    ["..." | object { assert?, compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }, ...]

这只是一些错误。

我知道React-Scripts使用WebPack的版本5,那么与此有关吗?

In my CRA, I am using storybook version 6.4.22, I was using react-scripts v 4.0.3 and have changed to version 5.0.1 however this has broken the storybook.

As per the instructions I did npx sb@next automigrate but now I get the error:

ERR! ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
ERR!  - configuration.module.rules[4] should be one of these:
ERR!    ["..." | object { assert?, compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }, ...]

This is just some of the errors.

I know react-scripts uses version 5 of webpack, so must be something to do with that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文