question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sorry, but you either have no stories or none are selected somehow.

See original GitHub issue

Hey! 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.

image

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:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
josectobarcommented, Jun 29, 2021

John from Chromatic pointed out the issue was coming from storybook-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. 🎉

1reaction
HosseinAghacommented, May 4, 2021

I’m facing the same issue with chromatic@5.8.0, @storybook/react@6.1.21, and npm@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.

Screen Shot 2021-05-04 at 5 32 41 pm

Screen Shot 2021-05-04 at 5 42 41 pm

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found