TypeError: Cannot read properties of undefined

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

The two reports point at src/sub-blocks/LayoutItem/LayoutItem.tsx (around line 18, reading links) and src/blocks/Icons/Icons.tsx (around line 43, reading map), both from older commits. Start by checking how those components receive block data and where a missing field could be undefined, then try to reproduce by removing fields from a page JSON. Done means either a guard that prevents the crash with a test covering the missing-field case, or a clear note that the bug no longer reproduces on the current code.

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

説明

Hello! I caught two errors with undefined block properties. TypeError: Cannot read properties of undefined (reading 'links')\n in https://github.com/gravity-ui/page-constructor/blob/baa0f3d337551a143eae7483f768a215b29c9e5c/src/sub-blocks/LayoutItem/LayoutItem.tsx#L18 and TypeError: Cannot read properties of undefined (reading 'map')\n in https://github.com/gravity-ui/page-constructor/blob/80f3cfa96818336e6acbb00f5e69590d9672fe12/src/blocks/Icons/Icons.tsx#L43

I don't know how to reproduce these errors because I found them in the logs. But this can be reproduced by editing the contents of the page-constructor component.

主要言語
TypeScript
スター
65
フォーク
27
平均マージ
5日 15分
マージ済み PR(30日)
15

環境構築

はじめの一歩

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

gravity-ui/page-constructor のほかの issue

gravity-ui/page-constructor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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