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/
225 stars 37 forks source link

Decorated properties that use `@internal` in their JSDoc comment fail to parse #194

Closed claviska closed 1 year ago

claviska commented 1 year ago

Playground issue

Reproduction URL: https://custom-elements-manifest.netlify.app/?source=CmltcG9ydCB7IExpdEVsZW1lbnQgfSBmcm9tICdsaXQtZWxlbWVudCc7CmltcG9ydCB7IHByb3BlcnR5IH0gZnJvbSAnbGl0L2RlY29yYXRvcnMuanMnOwoKCmV4cG9ydCBjbGFzcyBNeUVsZW1lbnQgZXh0ZW5kcyBMaXRFbGVtZW50IHsKICAvKioKICAgKiBAaW50ZXJuYWwgRGVzY3JpcHRpb24gaGVyZQogICAqLwogIEBwcm9wZXJ0eSgpIHRlc3QgPSAnJzsKfQo%3D&library=litelement

Additional information:

I noticed this by chance and figured I'd report it. This only seems to affected decorated properties. I can't get it to break with state or method fields.

Note that removing @internal from the comment eliminates the error. I've pasted the full dump below in case it helps.

Show Error Log ``` TypeError: Cannot read properties of undefined (reading 'name') at createAttributeFromField (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createAttribute.js:11:22) at file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/property-decorator.js:60:27 at Array.forEach () at handlePropertyDecorator (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/property-decorator.js:50:23) at analyzePhase (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/property-decorator.js:30:11) at file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:105:23 at withErrorHandling (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/utils/index.js:58:5) at file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:104:7 at Array.forEach () at visitNode (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:103:19) at withErrorHandling (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/utils/index.js:67:11) at file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:104:7 at Array.forEach () at visitNode (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:103:19) at visitNodes (/Users/example/path/node_modules/@custom-elements-manifest/analyzer/node_modules/typescript/lib/typescript.js:29004:30) at Object.forEachChild (/Users/example/path/node_modules/@custom-elements-manifest/analyzer/node_modules/typescript/lib/typescript.js:29243:24) at visitNode (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:109:8) at analyze (file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:100:3) at file:///Users/example/path/node_modules/@custom-elements-manifest/analyzer/src/create.js:51:5 at Array.forEach () node:internal/errors:857 const err = new Error(message); ^ ```
thepassle commented 1 year ago

should be fixed in https://github.com/open-wc/custom-elements-manifest/pull/196

claviska commented 1 year ago

I can confirm that this works as expected in 0.6.7. Many thanks!