storybook 6.3rc -切换到画布不起作用,

6l7fqoea  于 2022-10-29  发布在  其他
关注(0)|答案(3)|浏览(180)

描述Bug

切换到“画布”时,故事书已编译与--docs不工作。
您需要刷新页面。

系统

System:
    OS: macOS 11.2.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    npm: 7.12.1 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Browsers:
    Chrome: 91.0.4472.106
    Firefox: 88.0
    Safari: 14.0.3
  npmPackages:
    @storybook/addon-a11y: 6.3.0-rc.10 => 6.3.0-rc.10 
    @storybook/addon-essentials: 6.3.0-rc.10 => 6.3.0-rc.10 
    @storybook/vue: 6.3.0-rc.10 => 6.3.0-rc.10
l7wslrjt

l7wslrjt1#

描述Bug

6.3.8相同,除非刷新页面,否则无法在CanvasDocs之间切换。
start-storybook工作正常,但
也尝试了Chrome、Firefox和Safari,都导致了同样的问题。
系统

System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 15.10.0 - ~/.nvm/versions/node/v15.10.0/bin/node
    npm: 7.5.3 - ~/.nvm/versions/node/v15.10.0/bin/npm
  Browsers:
    Chrome: 94.0.4606.61
    Firefox: 91.0
    Safari: 14.1.2
  npmPackages:
    "@storybook/addon-a11y": "^6.3.8",
    "@storybook/addon-actions": "^6.3.8",
    "@storybook/addon-console": "^1.2.3",
    "@storybook/addon-essentials": "^6.3.8",
    "@storybook/addon-links": "^6.3.8",
    "@storybook/node-logger": "^6.3.8",
    "@storybook/react": "^6.3.8",
j2qf4p5b

j2qf4p5b2#

经过进一步的调查,我认为我所遇到的问题与我在@storybook/addon-docs上的配置有关。
如果我在main.js中将addons完全注解掉,它又可以正常工作了:

module.exports = {
  stories: ["../src/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
  addons: [
    "@storybook/addon-links",
    // {
    //   name: "@storybook/addon-docs",
    //   options: {
    //     configureJSX: true,
    //     transcludeMarkdown: true,
    //   },
    // },
    "@storybook/addon-essentials",
    "@storybook/addon-a11y",
  ],
  babel: async (options) => ({ ...babelConfig }),
};

我想知道,我是否错误地配置了插件,或者在使用@storybook/addon-docs@storybook/addon-essentials时出现了问题?

iq3niunx

iq3niunx3#

@TimJJTing不太可能。如果检测到插件是单独配置的,Addon-essentials应该自己配置一个插件。
具体而言:

addons: {
  { name: '@storybook/addon-docs', options: { .... } },
  '@storybook/addon-essentials'
}

应等同于:

addons: {
  { name: '@storybook/addon-docs', options: { .... } },
  { name: '@storybook/addon-essentials', options: { docs: false } }
}

也许是和configureJSX: true有关的东西??

相关问题