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.
In my local development, working on a plugin, I get a similarly strange behavior with respect to the composer.
The create topic button works in my local discourse instance, but then if I try to add a new create topic button somewhere else (and add some code to make that happen), it messes up, and all create topic buttons throughout the (local) site stop working.
And I get this error:
Uncaught Error: Assertion Failed: The key provided to set must be a string or number, you passed undefined
This continues even if I remove the code I added that seemed to cause the error in the first place. That is, once I get this error, even if I return all the code back to the way it was before, the error keeps coming up anytime I want to hit the create topic button.
The only thing that, I think, makes the error goes away, is if I remove the file entirely where the new code was (so, not having the file there–seems to work; having the file there with no code in it–the error continues).
Does anyone have any idea about this? It’s been a big hindrance to my development.