NODE_ENV option
Closed this issue · 2 comments
AmirL commented
Describe the bug
My storybook renders well when NODE_ENV is development
, but it fails when it's production
. (Mock functions obviously don't work in the production mode). There is option for NODE_ENV in the GitHub action: STORYBOOK_NODE_ENV
, but I don't see any mentions of such option for the addon. an
To reproduce
Just try to write a storybook that fails in production mode (throw an error, for example, depends on NODE_ENV).
Environment
Node v18.17.1
rChaoz commented
I've also had this issue and I fixed it by changing the build command for storybook in my package.json
:
{
"scripts": {
"build-storybook": "NODE_ENV=development storybook build -o build/storybook/",
}
}
Chromatic seemed to respect that.