# TypeError: Cannot read property 'id' of undefined

**URL:** https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922
**Category:** Support
**Created:** [November 28, 2018, 12:23am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922 "2018-11-28T00:23:11Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![TotalSoft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/totalsoft/32/125512_2.png) [@TotalSoft](https://meta.discourse.org/u/TotalSoft)
#### Post date: [November 28, 2018, 12:23am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/1 "2018-11-28T00:23:11Z")

</div>

Hi. 🌎

I can not use the buttons from the right: ![button](https://global.discourse-cdn.com/meta/original/3X/c/5/c52d2defd2565beef0506c1417ab635dffe8c2ed.png)

I turned off plugins in [safe mode](https://meta.discourse.org/t/53504?silent=true) 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?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 28, 2018, 2:41am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/2 "2018-11-28T02:41:55Z")

</div>

Have you tried updating to latest?

---

<div class="post-metadata">

### Author: ![TotalSoft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/totalsoft/32/125512_2.png) [@TotalSoft](https://meta.discourse.org/u/TotalSoft)
#### Post date: [November 28, 2018, 3:36am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/3 "2018-11-28T03:36:34Z")

</div>

Yes, I have this version installed: [v2.2.0.beta4 +358](https://github.com/discourse/discourse/compare/7dbf709467c85b3cf4cfc69dbd9150aeef77f850...tests-passed)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 28, 2018, 3:55am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/4 "2018-11-28T03:55:19Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![TotalSoft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/totalsoft/32/125512_2.png) [@TotalSoft](https://meta.discourse.org/u/TotalSoft)
#### Post date: [November 28, 2018, 4:50am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/5 "2018-11-28T04:50:51Z")

</div>

All:

- [discourse-assign](https://github.com/discourse/discourse-assign)
- [discourse-bbcode](https://github.com/discourse/discourse-bbcode)
- [discourse-canned-replies](https://github.com/discourse/discourse-canned-replies)
- [discourse-chat-integration](https://github.com/discourse/discourse-chat-integration)
- [discourse-policy](https://github.com/discourse/discourse-policy)
- [discourse-solved](https://github.com/discourse/discourse-solved)
- [discourse-spoiler-alert](https://github.com/discourse/discourse-spoiler-alert)
- [discourse-staff-notes](https://github.com/discourse/discourse-staff-notes)

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?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 28, 2018, 5:02am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/6 "2018-11-28T05:02:50Z")

</div>

> [@TotalSoft](#):
>
> If I disable this plugin

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 28, 2018, 6:14am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/7 "2018-11-28T06:14:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 28, 2018, 7:10am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/8 "2018-11-28T07:10:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 28, 2018, 5:22pm UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/9 "2018-11-28T17:22:17Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 28, 2018, 7:00pm UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/10 "2018-11-28T19:00:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 28, 2018, 7:23pm UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/11 "2018-11-28T19:23:51Z")

</div>

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](https://meta.discourse.org/t/forum-doesnt-work-as-expected-after-latest-upgrade-tests-passed/102884) is a different issue but I think [this one is the same issue](https://meta.discourse.org/t/whos-online-plugin-discourse-whos-online/52345/189) that was incorrectly attributed to the whos-online plugin.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 28, 2018, 7:34pm UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/12 "2018-11-28T19:34:14Z")

</div>

More or less, cc @sam @j.jaffeux @zogstrip

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 29, 2018, 3:23am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/13 "2018-11-29T03:23:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 29, 2018, 7:01am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/15 "2018-11-29T07:01:54Z")

</div>

I’ve sent you a PM with the details.

---

<div class="post-metadata">

### Author: ![ZackFea](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zackfea/32/123509_2.png) [@ZackFea](https://meta.discourse.org/u/ZackFea)
#### Post date: [November 29, 2018, 9:38am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/18 "2018-11-29T09:38:59Z")

</div>

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

> **[Rivven](https://rivven.community)**
>
> Multi-Gaming-Community

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.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [November 29, 2018, 9:55am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/19 "2018-11-29T09:55:26Z")

</div>

I think this commit will fix your issues:

[https://github.com/discourse/discourse/commit/4c7dfed32ea39cde85d575ae4b60fe2a70899c76](https://github.com/discourse/discourse/commit/4c7dfed32ea39cde85d575ae4b60fe2a70899c76)

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.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 29, 2018, 10:21am UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/20 "2018-11-29T10:21:01Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 29, 2018, 12:35pm UTC](https://meta.discourse.org/t/typeerror-cannot-read-property-id-of-undefined/102922/22 "2018-11-29T12:35:46Z")

</div>


