From bfb942bf9c7d93d124f707db7142c68d290c7885 Mon Sep 17 00:00:00 2001 From: Arjan van Wijk Date: Mon, 29 Nov 2021 15:56:53 +0100 Subject: [PATCH] Fix packageName check in build-dev The current check breaks for non-storybook packages. `Array.split` always returns 1 items at minimum, so with a `> 0` check in there it always executed the "if" part, breaking on the `.split()[1]` after. --- lib/core-server/src/build-dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core-server/src/build-dev.ts b/lib/core-server/src/build-dev.ts index 259fac8d700d..f1a662feccfd 100644 --- a/lib/core-server/src/build-dev.ts +++ b/lib/core-server/src/build-dev.ts @@ -112,7 +112,7 @@ export async function buildDevStandalone(options: CLIOptions & LoadOptions & Bui } // Get package name and capitalize it e.g. @storybook/react -> React - const packageName = name.split('@storybook/').length > 0 ? name.split('@storybook/')[1] : name; + const packageName = name.split('@storybook/').length > 1 ? name.split('@storybook/')[1] : name; const frameworkName = packageName.charAt(0).toUpperCase() + packageName.slice(1); outputStartupInformation({