NX Monorepo with an react-native in-app storybook errors #32865
Replies: 2 comments
-
|
Hi @josippapez! I'm Dosu and I’m helping the storybook team. Your setup and errors point to a common issue in monorepos: Storybook (and Metro) often resolve shared library imports to the built output in node_modules, not the source files. This can break things like emotion, context providers, and even basic prop passing, leading to the TypeErrors you’re seeing (e.g., Here’s what you can try:
If you try these steps and still see the same errors, double-check that your shared library is not being built and then imported from node_modules during Storybook runs. You want Metro to always resolve to the source files during development. References: Let me know if you need help with a specific config example or want to dig deeper into one of these steps! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
I did some digging and when the error pops up in the ios emulator, i get the link to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm using NX monorepo (latest) and a react native storybook (v10 rc1, although i tried downgrading to the latest v9 but still didn't help).

I've managed to set up the in-app storybook to render conditionally, and that works fine. But the stories won't work for some reason. They are defined outside the app in a separate NX package where other mobile components are defined (only one story is defined for test purposes).
But after i've added all of that and i try to run the storybook, i always get the errors below.
Additional information
Here's my .rnstorybook inside the app:
index.tsx
main.ts
preview.tsx
metroconfig
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions