prashantpalikhe / nuxt-ssr-lit

SSR support for Lit elements in Nuxt3
Other
42 stars 7 forks source link

`properties` of element are undefined #42

Closed steveworkman closed 1 year ago

steveworkman commented 1 year ago

Describe the bug When rendering an element, the customElementConstructor doesn't always have the properties of an element available, and the rendering errors with

TypeError: Cannot read properties of undefined (reading 'variant')                                                                                                                                                                                                                     11:45:54
    at Proxy.attachPropsToRenderer (file:////nuxt3/node_modules/nuxt-ssr-lit/dist/runtime/components/LitWrapperServer.mjs:38:70)
    at Proxy.serverPrefetch (file:////nuxt3/node_modules/nuxt-ssr-lit/dist/runtime/components/LitWrapperServer.mjs:75:12)

Additional context The there is a computed map of properties available called elementProperties - use that instead