storybook: [Bug]: Descriptions from JSDocs not rendered for Angular stories in 7.0.0-beta.60

Describe the bug

I have a Storybook set up for an Angular library which is using autodocs. I have updated to CSF3.

If I put JSDocs above my exported functions, they do not appear in the Doc page, either for the main description or on the individual stories.

e.g. following the docs, I had the following, but the description is not rendered.

/**
 * It should be possible to write a description here
 */
export const ExtensionCaseSensitive = {
  render: (args: FileDropzoneComponent) => ({
    props: args,
  }),
...

To Reproduce

https://github.com/freon27/storybook-issue-repro/

The doc page for Header should show the JSDocs (as far as I understand it).

System

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 16 (4 by maintainers)

Most upvoted comments

I can confirm that this is still an issue on Storybook 7.1.0 and Angular 16. It does not recognise JSDoc on any Angular components nor does it recognise the JSDoc on the Storybook meta and stories either.

Can confirm this issue still exists using Angular 14.3 and Storybook 7.0.21.

@abidhmuhsin after trying so many different things, your solution fixed it for me. Thank you!

@valentinpalkovic Thanks for fixing the bug in 7.6.4!

It works when I have the components & storybook within the same repository. When I use a NPM Angular Monorepro (no learna or NX) it does not show the docs.

The project structure looks like this:

package.json

  "workspaces": [
    "projects/my-library",
    "projects/my-storybook"
  ],

Do I need to configure / install something inside the my-library folder, so that projects/my-storybook can use the documentation?

Adding the fix that worked for me. The storybook tsconfig looked like it was parsing only stories.ts and preview.ts files. I had to manually add *.component.ts in the tsconfig includes array where the jsodc comments actually existed.

I created a library project using Angular 18 and added storybook to the library, but the jsdoc comments were not rendered. Versions used.

"@angular/core": "^18.2.0",    
"@angular/cli": "^18.2.0",
"storybook": "^8.2.9",

I could fix it by adding “…/src/lib/**/*.component.*” to the includes array in .storybook/tsconfig.json which was autogenerated in the library root folder when using npx storybook init. "include": ["../src/**/*.stories.*", "./preview.ts", "../src/lib/**/*.component.*"],

I am still experiencing this issue with Angular 16 and Storybook 7.6.4