描述错误
尝试从 8.1.11
升级到 8.2.0
(或 8.2.2
) 时,出现以下错误。似乎在依赖项精简(顺便说一下,这真的很棒)之后,可能需要添加回某个依赖项。
SB_BUILDER-WEBPACK5_0002 (WebpackInvocationError): Module not found: Error: Can't resolve 'storybook/internal/docs-tools' in './node_modules/.aspect_rules_js/@storybook+react@8.2.2_-2113478954/node_modules/@storybook/react/dist'
at ./node_modules/.aspect_rules_js/@storybook+builder-webpack5@8.2.2_303820626/node_modules/@storybook/builder-webpack5/dist/index.js:1:8835
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/HookWebpackError.js:68:3
at Hook.eval [as callAsync] (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/Hook.js:18:14)
at Cache.shutdown (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Cache.js:156:23)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compiler.js:1378:15
at Hook.eval [as callAsync] (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/Hook.js:18:14)
at Compiler.close (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compiler.js:1371:23)
at ./node_modules/.aspect_rules_js/@storybook+builder-webpack5@8.2.2_303820626/node_modules/@storybook/builder-webpack5/dist/index.js:1:8820
at finalCallback (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compiler.js:496:32)
at onCompiled (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compiler.js:510:20)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compiler.js:1326:21
at eval (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/EntryPlugin.js:49:5
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:2279:13
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:2168:6
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:2030:13
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:354:5
at Hook.eval [as callAsync] (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncQueue._handleResult (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:324:21)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:307:11
at onTransitiveTasksFinished (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:1544:20)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:1530:7
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:2030:13
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:354:5
at Hook.eval [as callAsync] (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncQueue._handleResult (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:324:21)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:307:11
at onTransitiveTasksFinished (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:1544:20)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:1530:7
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:1860:14
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:354:5
at Hook.eval [as callAsync] (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncQueue._handleResult (./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:324:21)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/util/AsyncQueue.js:307:11
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/Compilation.js:2105:13
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:904:13
at eval (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:341:22
at eval (eval at create (./node_modules/.aspect_rules_js/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:518:22
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:151:11
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:776:25
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:988:8
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:1118:5
at ./node_modules/.aspect_rules_js/neo-async@2.6.2/node_modules/neo-async/async.js:6883:13
at ./node_modules/.aspect_rules_js/webpack@5.93.0_275684263/node_modules/webpack/lib/NormalModuleFactory.js:1101:45
at finishWithoutResolve (./node_modules/.aspect_rules_js/enhanced-resolve@5.17.0/node_modules/enhanced-resolve/lib/Resolver.js:567:11)
at ./node_modules/.aspect_rules_js/enhanced-resolve@5.17.0/node_modules/enhanced-resolve/lib/Resolver.js:656:15
复现链接
.
复现步骤
- 无响应*
系统
.
附加上下文
- 无响应*
8条答案
按热度按时间qco9c6ql1#
请提供一个复制品,我可以看一下。
我怀疑你的依赖项中存在版本冲突,导致
storybook
包的版本比它应该的版本旧。q9rjltbz2#
@tony-scio 你的
package.json
中是否有storybook
作为依赖?你能分享一下你的完整
package.json
吗?sg2wtvxw3#
你是否使用storybook CLI中的升级命令进行了升级?
参见:https://storybook.js.org/docs/configure/upgrading#upgrade-script
k0pti3hp4#
感谢您的回复。我无法分享完整的package.json文件,但相关部分如下:
运行
npx storybook@latest upgrade
生成了相同的差异。w9apscun5#
当我们从8.1升级到8.2时,在运行测试时也遇到了类似的问题:
这发生在一个pnpm工作区中,当使用pnpm检查时,所有storybook的内容都是8.2.4,迁移已经运行。
似乎package.json中的导出没有被使用。
nwwlzxa76#
根据这些差异,我无法判断出了什么问题。
我确实需要一个复现来找出问题所在。
目前我唯一的想法是webpack中的某个东西阻止了export-map的使用/尊重。
这可能是webpack配置,或者是过时的webpack版本,这是我最好的猜测。
gzszwxb47#
是的,我理解需要一个复现环境,但遗憾的是它不是一个公共仓库,所以我不能分享。
会检查是否更新webpack是否有帮助。
bq3bfh9z8#
@johannesgoslar-synth 你能分享一些更多的信息吗?例如:
npx storybook info - 环境和storybook包的版本
npx storybook doctor - 对你的项目的检查
也许分享一下你的package.json/main.ts等文件的一些内容。