[Bug]: Error: 'MissingStoryAfterHmrError' is not exported by node_modules/@storybook/core-events/preview-errors.js, imported by node_modules/@storybook/preview-api/dist/index.mjs

9o685dep  于 6个月前  发布在  其他
关注(0)|答案(2)|浏览(47)

描述bug

最近我将storybook从v7升级到了v8,升级后出现了以下错误:
Error: 'MissingStoryAfterHmrError' is not exported by node_modules/@storybook/core-events/preview-errors.js, imported by node_modules/@storybook/preview-api/dist/index.mjs
node_modules/@storybook/preview-api/dist/index.mjs (8:276)
6: import mapValues2 from 'lodash/mapValues.js';
7: import pick from 'lodash/pick.js';
8: import { MissingStoryFromCsfFileError, CalledExtractOnStoreError, StoryStoreAccessedBeforeInitializationError, MissingRenderToCanvasError, StoryIndexFetchError, CalledPreviewMethodBeforeInitializationError, EmptyIndexError, NoStoryMatchError, MdxFileWithNoCsfReferencesError, MissingSto...

重现问题

我正在使用rollup进行应用程序的打包。: rollup --config --environment env_name
"rollup": "^4.17.0",

系统信息

Storybook Environment Info:

  System:
    OS: macOS 14.2.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
    npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm <----- active
  Browsers:
    Chrome: 124.0.6367.156
    Safari: 17.2.1
  npmPackages:
    @storybook/addon-actions: ^8.0.9 => 8.0.10 
    @storybook/addon-essentials: ^8.0.9 => 8.0.10 
    @storybook/addon-interactions: ^8.0.9 => 8.0.10 
    @storybook/addon-links: ^8.0.9 => 8.0.10 
    @storybook/addon-mdx-gfm: ^8.0.9 => 8.0.10 
    @storybook/addons: ^7.6.17 => 7.6.17 
    @storybook/blocks: ^8.0.9 => 8.0.10 
    @storybook/core-events: ^8.0.10 => 8.0.10 
    @storybook/preview-api: ^8.0.10 => 8.0.10 
    @storybook/test: ^8.0.9 => 8.0.10 
    @storybook/test-runner: ^0.17.0 => 0.17.0 
    @storybook/theming: ^8.0.9 => 8.0.10 
    @storybook/web-components: ^8.0.9 => 8.0.10 
    @storybook/web-components-webpack5: ^8.0.9 => 8.0.10 
    storybook: ^8.0.9 => 8.0.10 
    storybook-less-loader: ^0.1.0 => 0.1.0 
    storybook-multilevel-sort: ^2.0.0 => 2.0.0

其他上下文

  • 无响应*
pieyvz9o

pieyvz9o1#

你的所有故事书包版本都应该匹配。
你试过移除 node_modules 和/或锁文件并重新安装吗?

5lhxktic

5lhxktic2#

我尝试过移除node_moduleslockfiles,但问题仍未解决。

相关问题