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

Theme error when using Storybook 5.3+ #221

Closed
jayknott opened this issue Jan 22, 2020 · 6 comments · Fixed by #229
Closed

Theme error when using Storybook 5.3+ #221

jayknott opened this issue Jan 22, 2020 · 6 comments · Fixed by #229

Comments

@jayknott
Copy link

jayknott commented Jan 22, 2020

This is a follow up to issue #220. I am having the same issue and I do not set a custom theme at all. I had to add the following to make the error go away:

addParameters({ options: { theme: {} } });

@webketje
Copy link

In packages/storybook-readme/src/services/getParameters.js#L17, should be something like

...(parameters.options && parameters.options.theme ? parameters.options.theme : {})

@bbellmyers
Copy link

This fixes issue #228 as well

@marksy
Copy link

marksy commented Apr 3, 2020

Thanks @bbellmyers

FYI if you're using Typescript you need to define base;
.addParameters({ options: { theme: { base: '' } } });

@danielo515
Copy link

This is happening to me too. What is exactly the solution? I don't see any concrete example.
I am configuring my theme as it is explained on the docs of storybook. Could you please explain to me what I have to do from the normal up to date configuration?

@danielo515
Copy link

Ok, if anyone is looking for an up-to-date workaround with complete context, add this to your preview.js under your .storybook folder:

import { addParameters } from '@storybook/react';

addParameters({
  options: {
    theme: {}// this is just a workaround for addon-readme
  },
})

@jordymeow
Copy link

jordymeow commented Jun 9, 2020

If I use the code proposed by @danielo515, I get "Passed an incorrect argument to a color function, please pass a string representation of a color" instead of the previous error. My version of Storybook is 5.3.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants