redhat-developer / redhat-developer/vscode-java

TypeError: Cannot set properties of undefined (setting 'text')

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

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

extension-start
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

I see below error message in console when spring-petclinic is opened. Not sure about how to reproduce it. But some potential NPE must be there.

TypeError: Cannot set properties of undefined (setting 'text')
	at Object.e.update (c:\Users\admin\.vscode\extensions\redhat.java-1.10.0-win32-x64\dist\extension.js:2:724923)
	at Object.<anonymous> (c:\Users\admin\.vscode\extensions\redhat.java-1.10.0-win32-x64\dist\extension.js:2:768615)
	at Generator.next (<anonymous>)
	at o (c:\Users\admin\.vscode\extensions\redhat.java-1.10.0-win32-x64\dist\extension.js:2:764166)

Location should be:

https://github.com/redhat-developer/vscode-java/blob/d6a2fd53b97f8518ece92cbae4d4b580c1aafe69/src/languageStatusItemFactory.ts#L146

@CsCherrYY Can you take a look?

BTW if possible, can we replace item: any to leverage the type check, which would be good to prevent such error.

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

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

はじめの一歩

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

調査の方向性

src/languageStatusItemFactory.ts#L146 から始め、スタックトレースに示されている更新呼び出しと比較してください。item が undefined になり得る仕組みと、item: any を具体的な TypeScript 型に置き換えることで問題が明らかになるかを調査してください。原因を特定し、報告された TypeError を防止できれば完了です。

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

評価

技術スタック
typescript, vscode
領域
developer-experience, devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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