github / github/catalyst

Component not being rendered with Vite + preact-ts template

オープン
#298 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
1.4k
フォーク
59
平均マージ
22時間 12分
マージ済み PR(30日)
5

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the Vite configuration using the preact plugin and reproduce the issue from the preact-ts template. Compare the transpiled decorator output with the working version without the plugin; done means the @controller-decorated custom element renders in the HTML while the preact plugin remains enabled.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript, vite
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。