Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) Error: No docs.container set #17527

Closed
belforto opened this issue Feb 17, 2022 · 12 comments
Closed

Uncaught (in promise) Error: No docs.container set #17527

belforto opened this issue Feb 17, 2022 · 12 comments

Comments

@belforto
Copy link

belforto commented Feb 17, 2022

Why I get this error?
//storybook/main.tsx

stories: ["../src/components/**/.stories.@(tsx|mdx)", "../src/styles/.stories.@(tsx|mdx)",],

addons: [
"@storybook/addon-essentials",
"@storybook/addon-actions/register",
"@storybook/addon-controls",
"@storybook/addon-viewport",
{
name: '@storybook/addon-docs',
options: {
configureJSX: true,
babelOptions: {},
sourceLoaderOptions: null,
transcludeMarkdown: true,
},
},
],

and this is my mdx file
//BlogCard.stories.mdx

import { Meta, Story } from '@storybook/addon-docs/blocks';
import * as stories from './BlogCard.stories.tsx';
import BlogCard from "./index";

...some random markdown here

@blowsie
Copy link

blowsie commented Mar 30, 2022

I get a similar issue, reproduction is available here
https://github.com/blowsie/vue3-vitesse-storybook-pnpm/tree/master/packages/ui

image

@charleshimmer
Copy link

I'm getting this error after upgrading from storybook 6.4 to 6.5 using react. Every figure out what was going on?

@shilman
Copy link
Member

shilman commented May 24, 2022

@charleshimmer Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. Thank you! 🙏

@codesman
Copy link

I got this error today when I had accidentally installed @storybook/addon-docs": "6.5.5", when the rest of the storybook deps were at 6.4.22. The Docs tab was missing as well and the markdown in my .mdx was not rendered. This is in an NX 13.4.6 repo.

@charleshimmer
Copy link

I found my issue was the path for the addon-docs needed to be changed from '@storybook/addon-docs/preset' to '@storybook/addon-docs' in .storybook/main.js.

@charleshimmer
Copy link

Hot reloading does seem to not be working though now :(.

@konsalex
Copy link
Contributor

konsalex commented Jun 16, 2022

Hey folks, any update regarding this issue?

Happened to us too upgrading from 6.3.12 to 6.5.9. Additionally MDX stories are breaking too

@shilman
Copy link
Member

shilman commented Jun 21, 2022

@konsalex Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. Thank you! 🙏

@dagjomar
Copy link

Also had the same problem with version 6.5.9
Downgraded to the following set of versions and everything works fine again:

"@storybook/addon-actions": "~6.4.22",
"@storybook/addon-essentials": "~6.4.22",
"@storybook/addon-interactions": "~6.4.22",
"@storybook/addon-links": "~6.4.22",
"@storybook/builder-webpack5": "~6.4.22",
"@storybook/manager-webpack5": "~6.4.22",
"@storybook/react": "~6.4.22",
"@storybook/testing-library": "^0.0.11",

Would love for someone to figure out what the problem is

@kherock
Copy link
Contributor

kherock commented Aug 10, 2022

@shilman I don't have time to create a full repro, but I believe I was able track this regression to #17755.

I have two storybooks with this problem, and it seems like the only ingredient for this to occur is to have a custom .storybook/preview.js. The error is thrown due to some refactoring of getContainer() and getPage() parameters in the default addon-docs preset. In 6.4, they were configured in config.ts, loaded in the common-preset module:

module.exports = (storybookOptions, presetOptions) => {
return [
{ name: require.resolve('./common-preset'), options: presetOptions },
{ name: require.resolve('./dist/cjs/frameworks/common/preset'), options: presetOptions },
...getFrameworkPresets(storybookOptions.framework),
];
};

6.5 seems to have completely rewritten the preset entrypoint and I'm still investigating what needs to be done in order to fix this. In the meantime, I can get docs working again by including this in my .storybook/preview.js file:

export const parameters = {
  docs: {
    ...require('@storybook/addon-docs/preview').parameters.docs,
    // other config
  }
}

@bartaz
Copy link

bartaz commented Aug 11, 2022

I found my issue was the path for the addon-docs needed to be changed from '@storybook/addon-docs/preset' to '@storybook/addon-docs' in .storybook/main.js.

Thanks @charleshimmer this has solved this issue in our case as well.

ZedLi added a commit to hashicorp/boundary-ui that referenced this issue Feb 10, 2023
The storybook docs addon seems to break in versions >6.5.x currently. Keeping it a 6.3.x lets us keep using storybook.
See this issue in github: storybookjs/storybook#17527
ZedLi added a commit to hashicorp/boundary-ui that referenced this issue Feb 10, 2023
The storybook docs addon is broken in 6.5.x currently. Pinning it to
6.3.x lets us to continue using storybook. See this github issue:
storybookjs/storybook#17527

✅ Closes: ICU-7791
ZedLi added a commit to hashicorp/boundary-ui that referenced this issue Feb 15, 2023
The storybook docs addon is broken in 6.5.x currently. Pinning it to
6.3.x lets us to continue using storybook. See this github issue:
storybookjs/storybook#17527

✅ Closes: ICU-7791
@shilman
Copy link
Member

shilman commented Jun 9, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants