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

When `container` is `document`, cleanup steps fails with "TypeError: Cannot read properties of null (reading 'removeChild')"

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

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

  • #1330 @quisido による — マージされずにクローズ

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript, react
領域
testing-qa

調査の方向性

pure.js の、document.body.removeChild(container) を呼び出している cleanup 条件から始めてください。render(, { container: document }) を再現し、document.body が null の場合に cleanup を確認してください。TypeError が発生しなくなれば完了です。Issue では関連する PR #1330 に言及しているため、開始前にそのステータスを確認してください。

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

説明

Just opening this for tracking with the associated PR: #1330 .

When:

render(<Component />, { container: document });

(Untested: This bug may require that Component render a <body> element.)

Then:

TypeError: Cannot read properties of null (reading 'removeChild')

Because:

// pure.js
    if (container.parentNode === document.body) {
      document.body.removeChild(container);
    }

If we first check that document.body is not null, then this error will not occur.

主要言語
JavaScript
スター
19.7k
フォーク
1.2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

testing-library/react-testing-library のほかの issue

testing-library/react-testing-library の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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