open-wc/custom-elements-manifest

CEM Analyze fails when using `@link` in a `@param` tsdoc statement

matteematt opened this issue · 2 comments

Checklist

Completing the items above will greatly improve triaging time of your issue.

Expected behavior
I expect a manifest to be output, but instead it gives me this issue

> cem:analyze
> custom-elements-manifest analyze --config custom-elements-manifest.config.js

file:///Users/matt.walker/genesis/poc/cem-tsdoc-param-link-issue/node_modules/@custom-elements-manifest/analyzer/src/utils/index.js:67
    throw new Error(`\n\n[${name ?? 'unnamed-plugin'}]: ${errorMessage}\n\n ${e.stack}\n`);
          ^

Error:

[CORE - CLASSES]: Looks like you've hit an error in the core library. Please try to create a minimal reproduction at https://custom-elements-manifest.netlify.com and create an issue at: https://github.com/open-wc/custom-elements-manifest/issues

 TypeError: desc.startsWith is not a function
    at normalizeDescription (file:///Users/matt.walker/genesis/poc/cem-tsdoc-param-link-issue/node_modules/@custom-elements-manifest/analyzer/src/utils/jsdoc.js:10:12)

The instructions from the readme on the rest repo:

Demonstration of CEM Analyze issue

  1. npm install
  2. npm run cem:analyze
    Observe the error.
  3. Navigate to avatar.ts and change lines 26 and 27 and observe that it fixes the issue

You can fix the issue by changing @param to anther tag such as @return, or comment out the @link by escaping the @ symbol.

fixed and published in 0.8.1