Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Source attribute injection breaks JSX elements with generic type arguments

オープン
#274 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript
領域
tooling

調査の方向性

The issue identifies the Vite plugin injector and four failing TSX files, including platform/settings/SubscriptionWizard.tsx at line 101. Read the injector and its existing tests first, then reproduce the failure with a generic JSX element and nested generics. Done means the injected attributes follow the type arguments and both cases pass; the issue also calls for considering a source injection opt-out and updating the installer draft.

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

説明

area: overlay bug

What

The Vite plugin injects data-source-file and data-source-line attributes into JSX elements so findings can point at a source line. The plugin runs with enforce: 'pre', so it sees raw TSX before the React transform. A component used with a generic type argument, such as <PageWizard<SubscriptionWizardData> ...>, gets the attributes inserted inside the type argument and the file no longer parses. The dev server returns 500 for every module that imports it, and the application renders nothing.

Evidence

Measured on a real product UI the night before the freeze: platform/settings/SubscriptionWizard.tsx:101, platform/access/api-tokens/ApiTokenForm.tsx:157, platform/settings/runtime-feature-flags/FeatureFlagsPage.tsx:96, platform/settings/ui-flags/UIFlagsPage.tsx:30 all fail with Unexpected token at the position of the generic argument. The small demo application never showed it because it has no generic components. Moving the plugin later in the plugins array does not help because of enforce: 'pre'.

Direction

Make the injector skip a generic type argument list when it finds the tag name: treat <Name<...> as the element Name and insert the attributes after the closing > of the type arguments. Add a test with a generic element and one with nested generics. Until then, document in the installer's draft that applications using generic JSX elements should pass an option that disables source injection, if one exists, and add such an option if it does not.

主要言語
TypeScript
スター
0
フォーク
0
平均マージ
2時間 48分
マージ済み PR(30日)
8

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

usabl-dev/usabl のほかの issue

usabl-dev/usabl の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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