Users are encountering errors related to the Discourse composer when attempting to create new topics or replies. ivanrlio reports that post.get fails with “undefined key” when adding a reply, and post appears to be an object with a post number of (...), which resolves to 1. The same user later identifies that the issue stems from two plugins that reopen the composer controller. zogstrip suggests verifying whether post is an Ember object and recommends trying post.post_number instead. Separately, JQ331 describes a similar issue in local development: adding a custom “create topic” button breaks all such buttons site-wide, throwing the error Uncaught Error: Assertion Failed: The key provided to set must be a string or number, you passed undefined. Notably, the error persists even after removing the problematic code — only deleting the file entirely resolves it. Both issues appear to stem from plugin-related interference with the composer’s internal state or Ember object handling, suggesting a need to audit plugin code for improper object manipulation or reopens that break expected behavior.
En mi desarrollo local, trabajando en un plugin, experimento un comportamiento similarmente extraño en relación con Composer.
El botón “Crear tema” funciona en mi instancia local de Discourse, pero si intento agregar otro botón “Crear tema” en otro lugar (y añado algo de código para que eso suceda), todo se descompone y todos los botones “Crear tema” en todo el sitio (local) dejan de funcionar.
Y obtengo este error:
Uncaught Error: Assertion Failed: The key provided to set must be a string or number, you passed undefined
Esto continúa incluso si elimino el código que agregué y que parecía causar el error inicialmente. Es decir, una vez que obtengo este error, incluso si devuelvo todo el código a como estaba antes, el error sigue apareciendo cada vez que quiero hacer clic en el botón “Crear tema”.
Lo único que, creo, hace que el error desaparezca es eliminar por completo el archivo donde estaba el nuevo código (es decir, no tener el archivo allí parece funcionar; tener el archivo allí pero sin código en él, el error continúa).
¿Alguien tiene alguna idea sobre esto? Ha sido un gran obstáculo para mi desarrollo.