add optional chaining when there is issue with finding addon
MODIFY
bin-src/tasks/storybookInfo.ts
bin-src/tasks/storybookInfo.ts
@@ -5,6 +5,7 @@ import { initial, pending, success } from '../ui/tasks/storybookInfo';
export const setStorybookInfo = async (ctx: Context) => {
ctx.storybook = (await getStorybookInfo(ctx)) as Context['storybook'];
+ ctx.log.debug(ctx.storybook);
};
export default createTask({

MODIFY
bin-src/ui/tasks/storybookInfo.ts
bin-src/ui/tasks/storybookInfo.ts
@@ -11,7 +11,7 @@ const infoMessage = ({ addons, version, viewLayer, builder }: Context['storybook
const builderInfo = builder
? `${info}; using the ${builder.name} builder (${builder.packageVersion})`
: info;
- const supportedAddons = addons.filter((addon) => addon && addon.name);
+ const supportedAddons = addons?.filter((addon) => addon && addon.name);
return supportedAddons?.length
? `${builderInfo}; supported addons found: ${supportedAddons
.map((addon) => capitalize(addon.name))

add optional chaining when there is issue with finding addon