A user, TotalSoft, is experiencing an error: TypeError: Cannot read property 'id' of undefined when using the buttons on the right side of the screen. The issue disappears when official plugins are disabled.
sam suggests performing a binary search to find the culprit, while codinghorror suspects it might be the bbcode plugin. However, RGJ has the same issue after removing all plugins except the built-in ones and stripping all customizations.
RGJ shares that the issue only occurs on a single site of a multisite Discourse and is related to the category chooser. Unchecking tagging enabled removes the error, but reintroducing tagging on another forum reintroduces the issue.
The issue is later confirmed to be high priority, and RGJ shares details with the development team. ZackFea shares a URL of a site with the issue, and joffreyjaffeux finds a fix with a specific commit. RGJ confirms that the commit solves the issue.
I turned off plugins in safe mode and everything is ok – I’ve installed only the official plugins. Here is the error from console:
ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1 TypeError: Cannot read property 'id' of undefined
at r (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:2)
at s.valueForContentItem (application-80ee9fc6123d4a680c007646f102ba0abe0db9bfb9b32b60a347064dcf1d536e.js:1)
at s.computeContentItem (application-80ee9fc6123d4a680c007646f102ba0abe0db9bfb9b32b60a347064dcf1d536e.js:1)
at application-80ee9fc6123d4a680c007646f102ba0abe0db9bfb9b32b60a347064dcf1d536e.js:1
at Array.map (<anonymous>)
at s._beforeDidComputeContent (application-80ee9fc6123d4a680c007646f102ba0abe0db9bfb9b32b60a347064dcf1d536e.js:1)
at application-80ee9fc6123d4a680c007646f102ba0abe0db9bfb9b32b60a347064dcf1d536e.js:1
at invokeWithOnError (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1)
at a.flush (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1)
at u.flush (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1)
u @ ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1
3/message-bus/38fdf6ca16a24f668f085d106d1c7db2/poll?dlp=t:1 Failed to load resource: net::ERR_NETWORK_IO_SUSPENDED
If I disable this plugins, the error disappears and everything is fine after that. Yes, it happened in every subject.
Another error:
ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1 TypeError: Cannot read property 'id' of undefined
at r (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:2)
at s.valueForContentItem (application-d33b547293f4ad52584c3cc83b16713e30035872ddf4649bbca0092153963044.js:6)
at s.computeContentItem (application-d33b547293f4ad52584c3cc83b16713e30035872ddf4649bbca0092153963044.js:4)
at application-d33b547293f4ad52584c3cc83b16713e30035872ddf4649bbca0092153963044.js:4
at Array.map (<anonymous>)
at s._beforeDidComputeContent (application-d33b547293f4ad52584c3cc83b16713e30035872ddf4649bbca0092153963044.js:4)
at application-d33b547293f4ad52584c3cc83b16713e30035872ddf4649bbca0092153963044.js:5
at invokeWithOnError (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1)
at a.flush (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1)
at u.flush (ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1)
u @ ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:1
5[Violation] 'setTimeout' handler took <N>ms
[Violation] Forced reflow while executing JavaScript took 75ms
[Violation] Forced reflow while executing JavaScript took 32ms
How can I check which plugin is causing this error?
I know this involves a fair amount of work but do a binary search. Comment out half the plugins, then half of half and so on till you find the culprit.
We have seen the exact same thing after upgrading a test enviroment to latest (3e116bb14ed788c48bff8bf800bd4f506b8fc908) yesterday.
I have removed all plugins except for the built-in, stripped all customizations, enabled safe-mode and this error message is still persisting.
It is only happening on a single site of a multisite Discourse though (!). There are no customizations (anymore). I spent an hour stripping everything bare.
We were unable to reproduce this on another testsite, but we haven’t been able to solve this specific occurence either.
Firefox yields a slightly different error by the way, obj is undefined while Chrome says TypeError: Cannot read property 'id' of undefined
I’ll try to upgrade it to latest-latest again today.
Updated to latest and cleaned/precompiled all assets - still an issue.
Removed all posts and categories (it’s a test environment anyway) - still an issue.
Removed all site settings - still an issue
Restored a backup from long ago - issue is gone!
Restored backup from just before I restored the backup - issue is back
So this must be somewhere in the content but where…?
The issue only shows on pages that have a topic list, and only when I (or another user) is logged in.
When I look at the stack trace (valueForContentItem and computeContentItem) it seems like it’s related to the category chooser.
Does anyone have any idea where to look?
EDIT unchecking tagging enabled removes the error. But still…? The forum is not even using any tags.
EDIT #2 enabling tagging on another forum on the same multisite introduces the error there as well.
However @ZackFea I notice you do you have tags created on your site, so I’m unsure this will fix it, I have yet to recreate an issue with existing tags.