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: {} } });
In packages/storybook-readme/src/services/getParameters.js#L17, should be something like
...(parameters.options && parameters.options.theme ? parameters.options.theme : {})
This fixes issue https://github.com/tuchk4/storybook-readme/issues/228 as well
Thanks @bbellmyers
FYI if you're using Typescript you need to define base;
.addParameters({ options: { theme: { base: '' } } });
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?
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
},
})
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.
Most helpful comment
Ok, if anyone is looking for an up-to-date workaround with complete context, add this to your
preview.jsunder your.storybookfolder: