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

"push is not a function of null" #240

Closed jakebeatty closed 3 months ago

jakebeatty commented 4 months ago

On using the --litelement flag i appear to be getting an issue

"push is not a function of null" within static-properties.js, i am using a mixture of polymerjs v3 components within litelement components and appear to be getting this issue whenever the analyzer is run.

This seems to be a similar issue noted inside #163

I have made a fix inside a fork ive ported to a private gitlab for my own use and this resolves it for myself

     if(!currClass.attributes){
              currClass.attributes = [];
     }

      currClass.attributes.push(attribute);

Cheers

thepassle commented 3 months ago

Is the issue that you're analyzing polymer v3 components while using the --litelement flag?

jakebeatty commented 3 months ago

I am analyzing lit components that have polymer v3 components as dependencies eg importing 'paper-input' into a Lit component

thepassle commented 3 months ago

That shouldnt be a problem. Can you show me a minimal reproduction in the playground, and the fix you implemented privately so I can better understand what the problem is?

jakebeatty commented 3 months ago

Hmm, attempting to recreate this from a brand new component seems to not have this issue

I'm experiencing this with a monorepo where each component is being analyzed, ill have to look into this further myself as this might be an issue with my setup

will re-open if more detail can be given in future

jakebeatty commented 3 months ago

On further notice it looks like the config i had set for the analyzer wasnt quite correct and upon updating it has removed the issue

It was pulling in files containing parts i didnt need or want in the json generated anyway, updating the --globs flag did the trick

Apologies for the unnessary issue

thepassle commented 3 months ago

No worries!