Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bug - Decorator - Cannot destructure property 'addDef' of 'undefined' as it is undefined

Aperta
#290 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia dalla riga 27 di packages/module/src/components/defs/SVGDefs.tsx e analizza l’uso di Decorator nel branch example-decorator. Riproduci il problema con yarn install && yarn run start, yarn run start-console e la pagina OpenShift Topology. Il lavoro è completato quando il decorator viene renderizzato sul nodo di deployment senza l’errore di destrutturazione.

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

Descrizione

Describe the problem
Hi! I'm trying to add a decorator to a OpenShift Console dynamic plugin for use in their Topology page(s), but I'm running into the following error message when using the Decorator: TypeError: Cannot destructure property 'addDef' of 'undefined' as it is undefined

Example snippet: [Decorator x={x} y={y} radius={radius}][/Decorator]

My dev console is pointing here: https://github.com/patternfly/react-topology/blob/main/packages/module/src/components/defs/SVGDefs.tsx#L27

How do you reproduce the problem?

I've put together a branch to illustrate this: https://github.com/aptmac/console-plugin-template/tree/example-decorator

It's an OpenShift dynamic plugin, so you'll need a running instance of OpenShift or CRC to test against.

  1. In one terminal, install and run the plugin: yarn install && yarn run start
  2. In another terminal, run a local console frontend: yarn run start-console
  3. Have a running deployment. Quickest way would be to go to the Developer perspective -> +Add page, and under "Create applications using samples" select "Basic Quarkus" and follow the steps to create
  4. Go to the Topology page, and try to view the new deployment

The expected behaviour is that a new decorator should be present in the top left of the deployment node. The actual behaviour is the error message above.

Expected behavior
A clear and concise description of the expected behavior.

Is this issue blocking you?
List the workaround if there is one.

Screenshots

Actual: here's a screenshot of the error

image

Expected: I'm expecting a decorator and icon to be drawn in the top left of the node. Here I replaced the [Decorator] and used the icon directly instead and it appears, but it would look nicer with the decorator around it

image

What is your environment?

  • OS: Fedora 42

  • Browser: Chrome

  • Version: 140.0.7339.80


Jira Issue: PF-2650

Lingua principale
TypeScript
Stelle
21
Fork
27
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 patternfly/react-topology

Tutte le issue di patternfly/react-topology

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.