Sorry, but you either have no stories or none are selected somehow.
See original GitHub issueHey! How it’s going? Chromatic is not showing the stories content. I’ve tested in Brave and Mozilla. My local storybook build is working as expected.
Test.stories.tsx:
import { Meta } from '@storybook/react'
export const Test = () => <p>hello!</p>
export default {
title: 'Components/Test'
} as Meta
main.js:
import React from "react";
import { ThemeProvider } from "styled-components";
import { addDecorator } from "@storybook/react";
import { GlobalStyle } from "../src/globalStyles";
import { defaultTheme } from "../src/theme/default";
import { withThemesProvider } from "storybook-addon-styled-component-theme";
const themes = [defaultTheme];
addDecorator(withThemesProvider(themes), ThemeProvider);
export const decorators = [
(Story) => (
<>
<GlobalStyle />
<Story />
</>
),
];
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
};
preview.js:
import React from "react";
import { ThemeProvider } from "styled-components";
import { addDecorator } from "@storybook/react";
import { GlobalStyle } from "../src/globalStyles";
import { defaultTheme } from "../src/theme/default";
import { withThemesProvider } from "storybook-addon-styled-component-theme";
const themes = [defaultTheme];
addDecorator(withThemesProvider(themes), ThemeProvider);
export const decorators = [
(Story) => (
<>
<GlobalStyle />
<Story />
</>
),
];
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Storybook in create-react-app with TypeScript - Stack Overflow
I get storybook to build but it shows: No Preview Sorry, but you either have no stories or none are selected somehow. This...
Read more >Errors component • chromaui/chromatic-cli
No Preview. Sorry, but you either have no stories or none are selected somehow. Please check the Storybook config. Try reloading the page....
Read more >Embedding Storybook on Medium
Sorry, but you either have no stories or none are selected somehow. Please check the Storybook config. Try reloading the page. If the...
Read more >Embed stories - Storybook
Embed stories to showcase your work to teammates and the developer community at large. In order to use embeds, your Storybook must be...
Read more >without brand link ⋅ Storybook - BBC Open Source
No Preview. Sorry, but you either have no stories or none are selected somehow. Please check the Storybook config. Try reloading the page....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
John from
Chromatic
pointed out the issue was coming fromstorybook-addon-styled-component-theme
since it takes control over the rendering at runtime and it seems to only work in the Storybook UI’s context and not Chromatic’s. I was able to fix the issue by using https://github.com/semoal/themeprovider-storybook instead. 🎉I’m facing the same issue with
chromatic@5.8.0
,@storybook/react@6.1.21
, andnpm@6.14.12
.Also looks like chromatic sends output options to
build-storybook
script in the wrong format (at least for npm 6 and before we should add a--
for sending script specific params).I had to provide a custom output option to both storybook and chromatic script in order for this to work. But I still see empty snapshots and canvas in the chromatic app. Although clicking on the
view storybook
button in the Library shows that stories are fine.