The example should work, and I’m not aware of any relevant changes between the stable release and now. Let us know if you manage to reproduce the issue!
Uncaught (in promise) TypeError: While generating link to route "adminPlugins": this.model is undefined
get allAdminRoutes admin-plugins.js:20
note that I can put a debugger statement before the return this.model and it never fires the debugger.
@RGJ has kindly also looked at this and can repro this result.
This is a bit of a problem as clearly we need to develop stuff before it goes to production … but I don’t have to tell you that! Also a bit annoying it’s a problem on Stable …
I’m not sure how much we can do to fix this within Discourse - as you noted, the issue seems to be upstream in Ember. Perhaps we can patch the problematic method
To get us started, I’ve added a minimal failing test case so we can track progress. There are some comments in the test which describe why the issue is being triggered by our modifyClass system:
Funnily enough that seems to be the only progress over at the Ember project, within the associated PR which is still in Draft. I wonder if all that would be required is a polite request to prioritise it when the time becomes available?:
Yep, my test is based on theirs (but with the discourse-specific api.modifyClass api). I don’t think we should open a new issue - it’s 100% the same as the one that’s already open. We’ll see if we can do anything to get it prioritised.
This fix has now been released as part of Ember 3.28.12, and we’ve updated Discourse to use it. Please let us know if you’re still seeing any issues with modifyClass after updating to the latest Discourse.