github / github/catalyst

Component not being rendered with Vite + preact-ts template

Abierto
#298 7 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1.4k
Forks
59
Merge medio
22 h 12 min
PR fusionados (30 d)
5

Descripción

Using ` plugins: [ preact() ]` in `vite.config.js`

Tried to create a basic component, as shown in the guide:
```js
import {controller} from '@github/catalyst';

@controller
class TestThingElement extends HTMLElement {

connectedCallback() {
this.innerHTML = 'Hello World!';
}
}
```

Then use it from HTML:
```html

```

Nothing gets rendered on the page, and there's no errors. However, if I don't use the `@controller` decorator, or if I remove the preact plugin, it does work. I looked at the transpiled code and noticed this:
```js
let TestThingElement = controller(_class = class TestThingElement2 extends HTMLElement {
```

Any idea what's going on here? I assume this is causing problems with how Catalyst uses the class name to determine the custom element tag.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.