storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.74k stars 9.33k forks source link

[Bug]: Error: No `docs.container` set, did you run `addon-docs/preset`? #21557

Open jamiek-acl opened 1 year ago

jamiek-acl commented 1 year ago

Describe the bug

Getting this error in the console when try and look at generated docs:

renderDocs.js:36 Uncaught (in promise) Error: No `docs.container` set, did you run `addon-docs/preset`?
    at _callee$ (renderDocs.js:36:1)
    at tryCatch (runtime.js:63:1)
    at Generator.invoke [as _invoke] (runtime.js:293:1)
    at Generator.next (runtime.js:118:1)
    at asyncGeneratorStep (renderDocs.js:5:1)
    at _next (renderDocs.js:7:1)
    at renderDocs.js:7:1
    at new Promise (<anonymous>)
    at renderDocs.js:7:1
    at renderDocsAsync (renderDocs.js:17:1)

To Reproduce

git clone https://github.com/acl-services/paprika.git .
yarn
yarn storybook

Storybook will open. Click any component's "Docs" tab and watch the console, e.g. look at the "Avatar" component under the "Display" section, expand "Avatar" and click "Docs". Look at the console.

System

System:
    OS: macOS 13.2.1
    CPU: (10) x64 Apple M1 Pro
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v14.19.1/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Firefox: 106.0.5
    Safari: 16.3
  npmPackages:
    @storybook/addon-a11y: ^6.5.16 => 6.5.16
    @storybook/addon-actions: ^6.5.16 => 6.5.16
    @storybook/addon-cssresources: ^6.2.9 => 6.2.9
    @storybook/addon-docs: ^6.5.16 => 6.5.16
    @storybook/addon-knobs: ^6.4.0 => 6.4.0
    @storybook/addon-links: ^6.5.16 => 6.5.16
    @storybook/addons: ^6.5.16 => 6.5.16
    @storybook/react: ^6.5.16 => 6.5.16

Additional context

You can find the "Avatar" story under packages/Avatar/stories/Avatar.stories.mdx. In this file I tried both of these with no luck:

// import { Meta, Description } from "@storybook/addon-docs/blocks";
import { Meta, Description } from "@storybook/addon-docs";

In .storybook/main.js I tried both of these with no luck:

module.exports = {
  addons: [
//  "@storybook/addon-docs/preset",
    "@storybook/addon-docs",
  ],

Thank you.

shilman commented 1 year ago

Thanks for reporting! Have you tried upgrading to 7.0? We're heads down on getting that shipped and if your problem shows up there it's much more likely to get looked at/addressed. 🙏

Migration guide: https://storybook.js.org/migration-guides/7.0

cvharris commented 1 year ago

Duplicate of #17527