-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
After updating to 5.3.8 getStorybook() always returns an empty array #9622
Comments
I did update all configuration files according to the 5.3 specifications. On 5.2 I used to get the stories from the old /** @jsx createElement */
import { createElement } from 'react';
import CorePaletteComponent from './palette/palette';
import { getStorybook } from '@storybook/react';
const stories = getStorybook();
console.log(stories);
export default {
title: 'Core UI/Elements'
};
export const ColorPalette = () => <CorePaletteComponent />;
|
Did the code work before changing to main.js? I'm thinking that CSF doesn't work together with get Storybook. One thing that you might try is wrapping the getStorybook call in a setTimout. The problem is that CSF stories evaluate first THEN agree injected into the storystore. getStorybook asks the storystore which at this point in the runtime is Emory. |
I'm fairly sure this is NOT a bug in tri-config @shilman |
At best getStorybook returns an incomplete storystore. |
In 5.2.8 I was able to get the list, also I could get the list of stories in the configuration file
now I moved the same code to Using a setTimeout fixed the problem, so Ill close the issue, thanks! |
Preview.js executes before the configure call automated by main.js This is by design. |
@faberyx @ndelangen can you share how you get all stories (including CSF files) using |
Describe the bug
After upgrading to latest 5.3.8 version when calling getStorybook() from a story or from a configuration file always returns an empty array, before on 5.2 I was correctly getting an array of all stories.
Did something change in the new version?
The text was updated successfully, but these errors were encountered: