From ef5206b51e70a01959a492db4c083ef0779ee2d3 Mon Sep 17 00:00:00 2001 From: Jen Chan <6406037+usrrname@users.noreply.github.com> Date: Fri, 28 Apr 2023 11:04:59 -0400 Subject: [PATCH] fix(getStorySortParameters.ts): in getStorySortParameter, decl.init must be defined --- code/lib/csf-tools/src/getStorySortParameter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/csf-tools/src/getStorySortParameter.ts b/code/lib/csf-tools/src/getStorySortParameter.ts index b6e0a3bc4e10..426017c5f410 100644 --- a/code/lib/csf-tools/src/getStorySortParameter.ts +++ b/code/lib/csf-tools/src/getStorySortParameter.ts @@ -105,7 +105,7 @@ export const getStorySortParameter = (previewCode: string) => { node.declaration.declarations.forEach((decl) => { if (t.isVariableDeclarator(decl) && t.isIdentifier(decl.id)) { const { name: exportName } = decl.id; - if (exportName === 'parameters') { + if (exportName === 'parameters' && decl.init) { const paramsObject = stripTSModifiers(decl.init); storySort = parseParameters(paramsObject); }