Storybook as an NX standalone app failing to build #32300
-
SummaryI am using storybook as a standalone application inside an nx workspace, I have a library within the workspace exporting a button and the button's stories are defined inside the standalone application... I am able to run storybook in development mode, however, I am unable to build storybook for production and publishing to chromatic fails Additional informationEnvironment:
Error:
Create a reproductionhttps://github.com/mamello-justice/nx-storybook-standalone |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @mamello-justice! I'm Dosu and I’m helping the storybook team. The error To fix this, make sure all your libraries and your Storybook app use the same JSX runtime and compatible build tooling. Here’s what to check:
This should resolve the JSX runtime mismatch and allow your Storybook production build to succeed. If you continue to see issues, try running To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Hi @mamello-justice! I'm Dosu and I’m helping the storybook team.
The error
t.jsxDEV is not a function
almost always points to a mismatch in how JSX is transformed between your libraries and your Storybook app—typically, one is using the "automatic" JSX runtime and the other is not, or a library is being built in development mode and consumed in production mode. This is especially common in NX monorepos.To fix this, make sure all your libraries and your Storybook app use the same JSX runtime and compatible build tooling. Here’s what to check:
In every
tsconfig.json
(both in your libraries and the Storybook app), set"jsx": "react-jsx"
(or"automatic"
if using a newer TypeScript) to en…