TypeError: Cannot read property 'id' of undefined


#1

Hi. :earth_americas:

I can not use the buttons from the right: button

I turned off plugins in safe mode and everything is ok – I’ve installed only the official :discourse: 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

Any ideas?


(Jeff Atwood) #2

Have you tried updating to latest?


#3

Yes, I have this version installed: v2.2.0.beta4 +358


(Sam Saffron) #4

What official plugins are you running, can you help isolate the culprit by disabling one at a time?

Does this happen on all topics or just on one topic?


#5

All:

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?


(Sam Saffron) #6

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.


(Jeff Atwood) #7

It kinda has to be bbcode, doesn’t it? We run the rest of those plugins on our own internal sites…


(Richard - DiscourseHosting.com) #8

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.


(Richard - DiscourseHosting.com) #9

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.


(Jeff Atwood) #10

Are you on latest? I remember a fix for this going out a few days ago.


(Richard - DiscourseHosting.com) #11

Yes, upgraded to latest yesterday (twice) and today (twice).

Do you have any pointers about that fix? I can’t find anything that seems related.

This one is a different issue but I think this one is the same issue that was incorrectly attributed to the whos-online plugin.


(Jeff Atwood) #12

More or less, cc @sam @joffreyjaffeux @zogstrip


(Sam Saffron) #13

Note, this is extremely high priority for us but we need a repro or even a url of a site with the issue to debug


(Richard - DiscourseHosting.com) #15

I’ve sent you a PM with the details.


#18

As I mentioned in the thread that @RGJ linked, at my discourse the issue does appers. You can see it here:


If you need more informations, logs or something, let me know.

I did not found a feature that does not work yet, but the error still persist.


(Joffrey Jaffeux) #19

I think this commit will fix your issues:

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.

EDIT: I’m pretty sure this will fix it.


Failed to execute 'write' on 'Document - Amazon One Link JS
(Richard - DiscourseHosting.com) #20

I can confirm that that commit solves the issue. Thank you for your quick fix!


(Jeff Atwood) #22