You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { composeConfigs, PreviewWeb } from 'storybook/preview-api';
import { isPreview } from 'storybook/internal/csf';
These imports are relative to the project root, which can lead to the wrong version of Storybook being loaded in monorepo setups that include multiple versions. We should update builders to not rely on implicit, relative imports, but instead only accept the resolved path.
The text was updated successfully, but these errors were encountered:
** Disclaimer** This information might be inaccurate, due to it being generated automatically
This issue requires modifying the import resolution in the virtual entry files for both builders: 1. In code/builders/builder-vite/src/codegen-modern-iframe-script.ts, replace direct imports from 'storybook' with resolved paths: ts // Replace import { composeConfigs } from '@storybook/preview-api'; // With import { composeConfigs } from '${resolvedStorybookPath}/preview-api'; 2. Add import resolution logic to both builders to determine the correct Storybook package path relative to the project being built. 3. Update the codegen functions to use these resolved paths when generating the virtual entry files. This will ensure the correct version of Storybook is loaded in monorepo setups with multiple versions.
About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Our virtual entry files for both
builder-webpack5
andbuilder-vite
currently import from 'storybook' directly:storybook/code/builders/builder-vite/src/codegen-modern-iframe-script.ts
Lines 119 to 126 in a8efe8f
These imports are relative to the project root, which can lead to the wrong version of Storybook being loaded in monorepo setups that include multiple versions. We should update builders to not rely on implicit, relative imports, but instead only accept the resolved path.
The text was updated successfully, but these errors were encountered: