Skip to content

[BUG] Unable to generate the documentation with @deprecated tag #1300

Closed

Description

@andreasciamanna

I cannot generate the documentation as I get an error that, in the end, says to file the bug here.

I remember facing similar issues about a year ago when I decided to stop using compodoc.
Today I wanted to give it another go, but I see the problem still exists.

The stack trace does not give many clues about the cause of the error.
I can only guess the problem is either in compodoc or /graphql/src/payment/payment.service.ts, but on that file (assuming this is the one causing the issue), I can't see anything that could cause a problem.
The only JSDoc tag there is a @deprecated tag set for a the class' method:

/**
 * This method has been replaced by `AppStripeService:getPrice`
 * @deprecated This method has been replaced by AppStripeService:getPrice
 */

Once I remove the tag (I keep the rest), the error disappear.

This makes no sense as this is one of the few tags supported by compodoc.
Also, I can't remove the tag anyway, as devs must stop using that method.

Finally, the code base has plenty of @deprecated tags.
Some are written in the same form, other have even more "complex" formats (such as @deprecated {@link SomeClass#someMethod}).

For some reason, compodoc dislikes only this one.

A few side notes (or suggestions) to make the dev's life easier:

  • that error should tell what the "Unexpected type" (tag, file name and line) that causes the error is
  • add an option not to parse JSDoc tags
  • add an option to gracefully ignore the above errors (replace them with warnings), so at least "some" documentation can be generated
[08:24:01] parsing        : {MY_PROJECT_PATH}/graphql/src/payment/payment.service.ts
Unhandled Rejection at: Promise {
  <rejected> Error: Unexpected type
      at JsdocParserUtil.getJSDocTags ({MY_PROJECT_PATH}/graphql/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:820:31)

// ...
// a lot of stuff
// ...

    at ClassHelper.visitClassDeclaration ({MY_PROJECT_PATH}/graphql/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:7395:24)
[08:24:01] Sorry, but there was a problem during parsing or generation of the documentation. Please fill an issue on github. (https://github.com/compodoc/compodoc/issues/new)

Activity

  1. stale commented on Jan 8, 2023

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. natalia-lafever commented on Jan 31, 2023

    @natalia-lafever

    @andreasciamanna I just got this error for the first time, and the file also has a @deprecated tag on it, which has never caused an issue before.

  3. changed the title [-]Unable to generate the documentation[/-] [+][BUG] Unable to generate the documentation[/+] on May 20, 2023
  4. changed the title [-][BUG] Unable to generate the documentation[/-] [+][BUG] Unable to generate the documentation with @deprecated tag[/+] on May 20, 2023
  5. added a commit that references this issue on May 25, 2026
    50e87d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions