open-wc / custom-elements-manifest

Custom Elements Manifest is a file format that describes custom elements in your project.
https://custom-elements-manifest.open-wc.org/
234 stars 43 forks source link

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

Closed matteematt closed 1 year ago

matteematt commented 1 year ago

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)
matteematt commented 1 year ago

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.

thepassle commented 1 year ago

fixed and published in 0.8.1