We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch @storybook/source-loader@6.4.9 for the project I'm working on.
@storybook/source-loader@6.4.9
Here is the diff that solved my problem:
diff --git a/node_modules/@storybook/source-loader/dist/cjs/abstract-syntax-tree/parse-helpers.js b/node_modules/@storybook/source-loader/dist/cjs/abstract-syntax-tree/parse-helpers.js index 1a9a63b..5040657 100644 --- a/node_modules/@storybook/source-loader/dist/cjs/abstract-syntax-tree/parse-helpers.js +++ b/node_modules/@storybook/source-loader/dist/cjs/abstract-syntax-tree/parse-helpers.js @@ -83,7 +83,7 @@ function findTemplate(templateName, program) { if (node.type === 'VariableDeclaration') { declarations = node.declarations; - } else if (node.type === 'ExportNamedDeclaration' && node.declaration.type === 'VariableDeclaration') { + } else if (node.type === 'ExportNamedDeclaration' && node.declaration?.type === 'VariableDeclaration') { declarations = node.declaration.declarations; }
This issue body was partially generated by patch-package.
Not sure why but bumping from 6.4.0 to 6.4.9 leads to some node element (inside program.body) that have a node.declaration set to null:
6.4.0
6.4.9
node
program.body
node.declaration
null
{ node: { type: 'ExportNamedDeclaration', source: null, specifiers: [ { type: 'ExportSpecifier', local: { type: 'Identifier', name: 'Button', range: [ 266, 272 ], loc: { start: { line: 5, column: 8 }, end: { line: 5, column: 14 } }, start: 266, end: 272 }, exported: { type: 'Identifier', name: 'Button', range: [ 266, 272 ], loc: { start: { line: 5, column: 8 }, end: { line: 5, column: 14 } }, start: 266, end: 272 }, exportKind: 'value', range: [ 266, 272 ], loc: { start: { line: 5, column: 8 }, end: { line: 5, column: 14 } }, start: 266, end: 272 } ], exportKind: 'value', declaration: null, assertions: [], range: [ 258, 274 ], loc: { start: { line: 5, column: 0 }, end: { line: 5, column: 16 } }, start: 258, end: 274 } }
And breaks storybook.
The text was updated successfully, but these errors were encountered:
@mgcrea Do you mind creating a PR with the change? I think we can merge this as is. Thanks!
Sorry, something went wrong.
@shilman done :) #17027
fa3a289
Fix source-loader node.declaration edge case (closes storybookjs#16984)
6b847b7
Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.4 containing PR #17027 that references this issue. Upgrade today to the @next NPM tag to try it out!
@next
npx sb upgrade --prerelease
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.10 containing PR #17027 that references this issue. Upgrade today to the @latest NPM tag to try it out!
@latest
npx sb upgrade
shilman
No branches or pull requests
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
@storybook/source-loader@6.4.9
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
Not sure why but bumping from
6.4.0
to6.4.9
leads to somenode
element (insideprogram.body
) that have anode.declaration
set tonull
:And breaks storybook.
The text was updated successfully, but these errors were encountered: