Skip to content

[BUG] v1.1.14 breaking for @link reference #1104

@jacoblb64

Description

@jacoblb64
Overview of the issue
  • This is inside of a Typescript NestJS project
  • After updating to the latest version of compodoc, running throws the following error:
[13:22:45] found          : schema
Unhandled Rejection at: Promise {
  <rejected> Error: marked(): input parameter is of type [object Array], string expected
      at marked (/Users/user/workspace/project/node_modules/marked/src/marked.js:27:11)
      at /Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:600:23
      at arrayEach (/Users/user/workspace/project/node_modules/lodash/lodash.js:530:11)
      at Object.forEach (/Users/user/workspace/project/node_modules/lodash/lodash.js:9410:14)
      at markedtags (/Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:599:18)
      at AngularDependencies.visitFunctionDeclaration (/Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:9559:32)
      at parseNode (/Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:8984:43)
      at /Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:9260:13
      at visitNodes (/Users/user/workspace/project/node_modules/@ts-morph/common/dist/typescript.js:29004:30)
      at Object.forEachChild (/Users/user/workspace/project/node_modules/@ts-morph/common/dist/typescript.js:29243:24)
} reason: Error: marked(): input parameter is of type [object Array], string expected
    at marked (/Users/user/workspace/project/node_modules/marked/src/marked.js:27:11)
    at /Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:600:23
    at arrayEach (/Users/user/workspace/project/node_modules/lodash/lodash.js:530:11)
    at Object.forEach (/Users/user/workspace/project/node_modules/lodash/lodash.js:9410:14)
    at markedtags (/Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:599:18)
    at AngularDependencies.visitFunctionDeclaration (/Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:9559:32)
    at parseNode (/Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:8984:43)
    at /Users/user/workspace/project/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:9260:13
    at visitNodes (/Users/user/workspace/project/node_modules/@ts-morph/common/dist/typescript.js:29004:30)
    at Object.forEachChild (/Users/user/workspace/project/node_modules/@ts-morph/common/dist/typescript.js:29243:24)
[13:22:45] 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)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.4.0 compodoc: `compodoc -s`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the project@0.4.0 compodoc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user/.npm/_logs/2021-07-21T17_22_45_678Z-debug.log

(username and project path redacted)

After doing some testing, it appears due to @link tags in our TSDoc comments, like the below:

/**
 * A specific client for X usage
 *
 * @see Client interface: {@link Client}
 */
export class ClientChild implements Client {...}

We've been following usage from the TSDoc documentation for @link.

Removing {@link Client} allows compodoc to succeed. We're seeing this happen for all @link tags, not just on classes as well.

Additionally the same code and comments is parsed just fine on v1.1.13 and lower.

Operating System, Node.js, npm, compodoc version(s)

MacOS 11.4 Big Sur
Node 14.17.0
NPM 6.14.13
Compodoc 1.1.14
NestJS 8.0.3

Compodoc installed globally or locally ?

Compodoc installed locally as a dev dependency

Motivation for or Use Case

VSCode picks up the @link tag and is a useful tool!

Reproduce the error

add a @link

Related issues

Seems similar to #294 which was marked as fixed in this release

--
Thanks so much for making compodoc, it's an extremely useful tool and wanted to report this bug to help out!
Please let me know if there's any additional information I can provide or anything else I can do to help with this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions