diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index f139d09a8532..37f62ef4fb9c 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -371,12 +371,12 @@ export const addStories: Task['run'] = async ( const storiesPath = await findFirstPath([join('src', 'stories'), 'stories'], { cwd }); const mainConfig = await readMainConfig({ cwd }); + const packageManager = JsPackageManagerFactory.getPackageManager(); // Ensure that we match the right stories in the stories directory - const packageJson = await import(join(cwd, 'package.json')); updateStoriesField( mainConfig, - (await detectLanguage(packageJson)) === SupportedLanguage.JAVASCRIPT + (await detectLanguage(packageManager)) === SupportedLanguage.JAVASCRIPT ); const isCoreRenderer =