diff --git a/packages/storybook/src/executors/storybook/storybook.impl.ts b/packages/storybook/src/executors/storybook/storybook.impl.ts index b077137170..b07532a1b2 100644 --- a/packages/storybook/src/executors/storybook/storybook.impl.ts +++ b/packages/storybook/src/executors/storybook/storybook.impl.ts @@ -14,8 +14,10 @@ export default async function* storybookExecutor( success: boolean; info?: { port: number; baseUrl?: string }; }> { - const storybook7 = storybookMajorVersion() >= 7; - if (!storybook7) { + const sbVersion = storybookMajorVersion(); + const sbLessThan7 = sbVersion < 7 && sbVersion > 0; + + if (sbLessThan7) { throw pleaseUpgrade(); } storybookConfigExistsCheck(options.configDir, context.projectName); diff --git a/packages/storybook/src/utils/utilities.ts b/packages/storybook/src/utils/utilities.ts index 5ddb355b51..a7df73c46a 100644 --- a/packages/storybook/src/utils/utilities.ts +++ b/packages/storybook/src/utils/utilities.ts @@ -268,7 +268,7 @@ export function getTsSourceFile(host: Tree, path: string): ts.SourceFile { export function pleaseUpgrade(): string { return ` - Storybook 6 is no longer maintained, and not supported in Nx. + Storybook 6 and lower are no longer maintained, and not supported in Nx. Please upgrade to Storybook 7. Here is a guide on how to upgrade: