gpt4 book ai didi

javascript - Storybook 的迁移

转载 作者:行者123 更新时间:2023-11-30 06:12:37 24 4
gpt4 key购买 nike

我想将 Storybook 从 5.0.11 迁移到 5.2.0 但在更改 package.json 中的版本后我得到:

ERROR in ./node_modules/@storybook/theming/dist/utils.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/dist'
@ ./node_modules/@storybook/theming/dist/utils.js 9:0-42
@ ./node_modules/@storybook/theming/dist/index.js
@ ./config/.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

ERROR in ./node_modules/@storybook/theming/node_modules/@storybook/client-logger/dist/index.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/node_modules/@storybook/client-logger/dist'
@ ./node_modules/@storybook/theming/node_modules/@storybook/client-logger/dist/index.js 3:0-42
@ ./node_modules/@storybook/theming/dist/ensure.js
@ ./node_modules/@storybook/theming/dist/index.js
@ ./config/.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

ERROR in ./node_modules/@storybook/theming/dist/index.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.for-each' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/dist'
@ ./node_modules/@storybook/theming/dist/index.js 3:0-44
@ ./config/.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

ERROR in ./node_modules/@storybook/theming/dist/convert.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.index-of' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/dist'
@ ./node_modules/@storybook/theming/dist/convert.js 5:0-44
@ ./node_modules/@storybook/theming/dist/index.js
@ ./config/.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

我也在迁移指南中寻找,但没有找到我应该做些什么来完成它。

最佳答案

解决方案下方(希望对您有所帮助):

{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declarationMap": false
}
}

package.json 中迁移的依赖项:

"@storybook/addon-actions": "^5.2.0",
"@storybook/addon-centered": "^5.2.0",
"@storybook/addon-info": "^5.2.0",
"@storybook/addon-knobs": "^5.2.0",
"@storybook/addon-storysource": "^5.2.0",
"@storybook/addon-viewport": "^5.2.0",
"@storybook/components": "^5.2.0",
"@storybook/react": "^5.2.0",
"@storybook/source-loader": "^5.2.0",
"@storybook/theming": "^5.2.0",

还需要从 babel-loader 迁移到 ts-loader

关于javascript - Storybook 的迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57988934/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com