You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In a Svelte project, Storybook fails to generate a component documentation when it contains nested inline arrow functions (i.e. () => () => {}).
To Reproduce
Steps to reproduce the behavior:
Create a simple Svelte project with Storybook. You can bootstrap one using npx degit chromaui/intro-storybook-svelte-template taskbox for example;
Install dependencies;
Run storybook (npm run storybook or yarn storybook);
In any Svelte file, add an arrow function like in the "Code snippets" section below in one of the components;
You should see an error in the console (see "Additional context"). Additionally, the component documentation will be empty.
Additional context
The following error is displayed by Webpack during the build:
TypeError: nodes.forEach is not a function
at Parser.parseBodyRecursively (<path>/node_modules/sveltedoc-parser/lib/v3/parser.js:251:15)
at <path>/node_modules/sveltedoc-parser/lib/v3/parser.js:331:38
at Array.forEach (<anonymous>)
at <path>/node_modules/sveltedoc-parser/lib/v3/parser.js:311:27
at Array.forEach (<anonymous>)
at Parser.parseBodyRecursively (<path>/node_modules/sveltedoc-parser/lib/v3/parser.js:251:15)
at Parser.parseScriptBlock (<path>/node_modules/sveltedoc-parser/lib/v3/parser.js:571:14)
at <path>/node_modules/sveltedoc-parser/lib/v3/parser.js:72:22
at Array.forEach (<anonymous>)
at Parser.__walk (<path>/node_modules/sveltedoc-parser/lib/v3/parser.js:71:36)
at <path>/node_modules/sveltedoc-parser/lib/v3/parser.js:56:22
This error occurs in sveltedoc-parser in versions <4.1.0. Storybook uses version 3.0.5, and forcing the dependency to ^4.1.0 seem to solve the issue.
The text was updated successfully, but these errors were encountered:
jogarijo
changed the title
Svelte compontent documentation not generated when using inline arrow functions (() => () => {})
Svelte component documentation not generated when using inline arrow functions (() => () => {})
Mar 7, 2021
Describe the bug
In a Svelte project, Storybook fails to generate a component documentation when it contains nested inline arrow functions (i.e.
() => () => {}
).To Reproduce
Steps to reproduce the behavior:
npx degit chromaui/intro-storybook-svelte-template taskbox
for example;npm run storybook
oryarn storybook
);Expected behavior
There should be no error
Code snippets
System
Additional context
The following error is displayed by Webpack during the build:
This error occurs in
sveltedoc-parser
in versions<4.1.0
. Storybook uses version3.0.5
, and forcing the dependency to^4.1.0
seem to solve the issue.The text was updated successfully, but these errors were encountered: