Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
claviska opened this issue Jan 6, 2023 · 2 comments

Comments

@claviska
Copy link

claviska commented Jan 6, 2023

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 (<anonymous>)
    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 (<anonymous>)
    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 (<anonymous>)
    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 (<anonymous>)
node:internal/errors:857
  const err = new Error(message);
              ^
@thepassle
Copy link
Member

should be fixed in #196

@claviska
Copy link
Author

claviska commented Jan 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants