Closed wickedst closed 1 year ago
@wickedst you probably just need to add ../../../packages/design-system to your metro watch folders
Hi @dannyhw thanks for the quick response, I forgot to mention I had done that as per the expo docs
// Learn more https://docs.expo.dev/guides/monorepos
const { getDefaultConfig } = require("expo/metro-config");
const path = require("path");
// Find the project and workspace directories
const projectRoot = __dirname;
// This can be replaced with `find-yarn-workspace-root`
const workspaceRoot = path.resolve(projectRoot, "../..");
const config = getDefaultConfig(projectRoot);
// 1. Watch all files within the monorepo
config.watchFolders = [workspaceRoot];
// 2. Let Metro know where to resolve packages and in what order
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true;
// add storybook stuff - https://github.com/storybookjs/react-native
config.resolver.resolverMainFields.unshift("sbmodern");
module.exports = config;
Hey, I've confirmed this is an issue with my general setup, and not storybook react native. I'll post an update if I manage to solve
Hi there, I am attempting to set up storybook inside an expo monorepo (set up the recommended way as per the expo docs). I've set up storybook inside
projects/storybook
using the steps from these docs. Running web mode at this point works, however when moving the components topackages/design-system
I get the error below. Thanks!To Reproduce Steps to reproduce the behavior:
yarn create expo-app projects/storybook
cd projects/storybook && npx sb@next init --type react_native
<root>/projects/design-system
.storybook/main.js
stories tostories: ["../../../packages/design-system/**/*.stories.?(ts|tsx|js|jsx)"],
(This is the correct path as evidenced by the error picking up the jsxyarn sb-rn-get-stories && expo start --web
, see the error above