Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

TUI crash: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base')

Abierto Apto para principiantes
#54,762 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Finn763 ya está trabajando en esto.

Desde el 12/10/2026.

  • #54802 de @Finn763 — abierto
  • #54817 de @Ji-Sir — cerrado sin fusionar

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
frontend, tooling

Línea de trabajo

Empieza en packages/tui/src/ui/toast.tsx, especialmente en la búsqueda del tema en la línea 54, y lee el tipo de variante del toast en la línea 11 junto con el esquema de feedback en packages/theme/src/tui/schema.ts. Reproduce el problema con una variante no válida como warn o con un tema personalizado parcial al que le falte esa entrada. La tarea está terminada cuando una entrada de feedback no válida o ausente ya no hace que la TUI se bloquee; el issue no especifica un archivo de pruebas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

reproduced

Summary

The TUI hard-crashes when a plugin calls ui.toast.show() with a toast variant that is not a valid theme feedback key. The theme lookup in packages/tui/src/ui/toast.tsx:54 is unguarded:

borderColor={theme.text.feedback[props.toast.variant].base}

A single invalid variant string from a third-party plugin (in my case "warn" instead of "warning") throws a TypeError in the render pass and takes down the entire TUI with the crash screen. My plugin's call was wrapped in try/catch, but the exception fires later during rendering, so plugin-level fail-open wrappers cannot catch it.

Environment

  • opencode version: 2.0.27
  • OS: macOS 24.6.0 (darwin x64)
  • Terminal: tmux 3.6a
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: local global plugins in ~/.config/opencode/plugins/ — brain-logger.js, identity-anchor.js, pantheon-hub/ (TUI plugin; crash trigger)

Reproduction

  1. Add a TUI plugin in ~/.config/opencode/plugins/ that calls context.ui.toast.show({ message: "hello", variant: "warn" }) — invalid: the variant union at packages/tui/src/ui/toast.tsx:11 is "info" | "success" | "warning" | "error", and text.feedback in packages/theme/src/tui/schema.ts only defines error / warning / success / info.
  2. Trigger the call (e.g. from a palette/slash command).
  3. The toast renders → TypeError → full TUI crash screen.

Expected Behavior

One (or more) of:

  • ui.toast.show() validates/clamps the variant at the plugin API boundary, falling back to info for unknown values;
  • the theme lookup at toast.tsx:54 guards against missing entries with a fallback color;
  • at minimum the error surfaces in the plugin's call frame rather than crashing the whole TUI render.

Actual Behavior

TypeError: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base') — the entire TUI crashes.

Relevant stack frames:

at <anonymous> (chunk-k3c2wewa.js:2590:13646)   ← toast render, unguarded theme lookup
at show (chunk-k3c2wewa.js:2590:14589)
at show (chunk-k3c2wewa.js:2592:29350)
at run (~/.config/opencode/plugins/pantheon-hub/tui.tsx:264:34)   ← plugin command handler

Additional Context

  • The triggering call was my own plugin bug ("warn" is not a valid variant), but the reportable issue is that any plugin passing an invalid variant string — or a variant whose entry is missing from a partial custom theme (text.feedback.* entries are Schema.optional in packages/theme/src/tui/schema.ts:94-101) — kills the whole TUI. There is no error boundary in the toast render path.
  • The warn vs warning mismatch is an easy mistake for plugin authors: the variant key is warning, while log levels elsewhere use warn (e.g. client.app.log levels: debug, info, warn, error).
Full stack trace from the crash screen
Error: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base')
    at <anonymous> (/$bunfs/root/chunk-k3c2wewa.js:2590:13646)
    at Ve (/$bunfs/root/chunk-qxet3sb1.js:2:9872)
    at K (/$bunfs/root/chunk-qxet3sb1.js:2:9653)
    at T_ (/$bunfs/root/chunk-qxet3sb1.js:2:3651)
    at <anonymous> (/$bunfs/root/chunk-k3c2wewa.js:2590:13574)
    at qi (/$bunfs/root/chunk-qxet3sb1.js:2:6895)
    at Ve (/$bunfs/root/chunk-qxet3sb1.js:2:9872)
    at K (/$bunfs/root/chunk-qxet3sb1.js:2:9653)
    at Z (/$bunfs/root/chunk-qxet3sb1.js:2:11338)
    at $e (/$bunfs/root/chunk-qxet3sb1.js:2:12211)
    at wt (/$bunfs/root/chunk-qxet3sb1.js:2:11613)
    at D (/$bunfs/root/chunk-qxet3sb1.js:2:11518)
    at g (/$bunfs/root/chunk-j7geqk7h.js:3:23104)
    at show (/$bunfs/root/chunk-k3c2wewa.js:2590:14589)
    at show (/$bunfs/root/chunk-k3c2wewa.js:2592:29350)
    at run (/Users/dev10/.config/opencode/plugins/pantheon-hub/tui.tsx:264:34)
    at a (/$bunfs/root/chunk-qt5e0j2h.js:2:31593)
    at u (/$bunfs/root/chunk-qt5e0j2h.js:2:32383)
    at d (/$bunfs/root/chunk-qt5e0j2h.js:2:32909)
    at a (/$bunfs/root/chunk-qt5e0j2h.js:2:92434)
    at run (/$bunfs/root/chunk-qt5e0j2h.js:2:97068)
    at Ze (/$bunfs/root/chunk-wp49df1n.js:27:10030)
    at run (/$bunfs/root/chunk-wp49df1n.js:27:11283)
    at a (/$bunfs/root/chunk-qt5e0j2h.js:2:31593)
    at runBinding (/$bunfs/root/chunk-qt5e0j2h.js:2:34042)
    at Se (/$bunfs/root/chunk-qt5e0j2h.js:2:54571)
    at Be (/$bunfs/root/chunk-qt5e0j2h.js:2:48704)
    at Ne (/$bunfs/root/chunk-qt5e0j2h.js:2:47228)
    at Te (/$bunfs/root/chunk-qt5e0j2h.js:2:46395)
    at <anonymous> (/$bunfs/root/chunk-qt5e0j2h.js:2:67932)
    at emitWithPriority (/$bunfs/root/chunk-43sqsmcd.js:28:10236)
    at processParsedKey (/$bunfs/root/chunk-43sqsmcd.js:28:9705)
    at handleStdinEvent (/$bunfs/root/chunk-43sqsmcd.js:203:5433)
    at <anonymous> (/$bunfs/root/chunk-43sqsmcd.js:203:4996)
    at drain (/$bunfs/root/chunk-43sqsmcd.js:34:9334)
    at drainStdinParser (/$bunfs/root/chunk-43sqsmcd.js:203:4968)
    at <anonymous> (/$bunfs/root/chunk-43sqsmcd.js:203:2834)
    at emit (node:events:100:22)
    at addChunk (internal/streams/readable:267:47)
    at readableAddChunkPushByteMode (internal/streams/readable:245:18)
    at internalRead (native)
    at processTicksAndRejections (native)
Lenguaje dominante
TypeScript
Estrellas
213k
Forks
28.4k
Merge medio
8 h 51 min
PR fusionados (30 d)
289

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de anomalyco/opencode

Todos los issues de anomalyco/opencode

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.