TypeError: Cannot read properties of undefined

Aperta
#950 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
65
Fork
27
Merge medio
5g 15m
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gravity-ui/page-constructor

Tutte le issue di gravity-ui/page-constructor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.