Open
Description
Describe the bug
I am trying to add storybook to my turbo repo monorepo for my UI library. I am using story book react-native-web-vite as my renderer. However, when referencing stories outside of storybook app as shown in the turborepo docs I get an error:
This error is not present in my terminal just the ui. Using the glob npm package I have verified all paths are correct and even tried absolute paths. Here is my main.ts
file:
import {join, dirname} from "path";
import type {StorybookConfig} from "@storybook/react-native-web-vite";
import {createRequire} from "module";
const require = createRequire(import.meta.url);
/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value) {
return dirname(require.resolve(join(value, "package.json")));
}
const config: StorybookConfig = {
stories: ["../../../packages/ui/src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
getAbsolutePath("@chromatic-com/storybook"),
getAbsolutePath("@storybook/addon-vitest"),
],
framework: {
name: getAbsolutePath("@storybook/react-native-web-vite"),
options: {},
},
};
export default config;
Other than that my configuration is normal. Here is my story file:
import {Meta} from "@storybook/react-native-web-vite";
import Button from "../Button";
const meta: Meta<typeof Button> = {
title: "Button",
component: Button,
};
export default meta;
Reproduction link
https://github.com/ethan-krich/storybook-turbo-repo
Reproduction steps
pnpm install
cd apps/ui-stories
pnpm storybook
System
System:
OS: macOS 15.5
CPU: (12) arm64 Apple M2 Max
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.4.0 - ~/.nvm/versions/node/v23.4.0/bin/node
npm: 11.4.2 - ~/.nvm/versions/node/v23.4.0/bin/npm
pnpm: 10.12.1 - ~/Library/pnpm/pnpm <----- active
Browsers:
Safari: 18.5
npmPackages:
@storybook/addon-a11y: ^9.0.11 => 9.0.11
@storybook/addon-docs: ^9.0.11 => 9.0.11
@storybook/addon-onboarding: ^9.0.11 => 9.0.11
@storybook/addon-vitest: ^9.0.11 => 9.0.11
@storybook/react-native-web-vite: ^9.0.11 => 9.0.11
storybook: ^9.0.11 => 9.0.11
Additional context
No response