# Cannot call method 'substr' of undefined error

**URL:** <https://community.miniprofiler.com/t/cannot-call-method-substr-of-undefined-error/119>\
**Category:** uncategorized\
**Created:** [June 15, 2012, 4:53am UTC](https://community.miniprofiler.com/t/cannot-call-method-substr-of-undefined-error/119 "2012-06-15T04:53:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Jobin](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Alexandre\_Jobin](https://community.miniprofiler.com/u/Alexandre_Jobin)\
**Post date:** [June 15, 2012, 4:53am UTC](https://community.miniprofiler.com/t/cannot-call-method-substr-of-undefined-error/119/1 "2012-06-15T04:53:37Z")

</div>

I get this error here and there in my webpage but i can’t figure out when and why exactly. This happend at the load of the page. I tried with v2.0.1 and with the trunk version.

I will investigate further when i will have time.

**Stacktrace**

- Uncaught TypeError: Cannot call method ‘substr’ of undefined includes.js:165
- toggleIt includes.js:165
- toggleHidden includes.js:180
- buttonShow includes.js:147
- $.ajax.success includes.js:117
- f.Callbacks.n jquery.1.7.1.js:2
- f.Callbacks.o.fireWith jquery.1.7.1.js:2
- w jquery.1.7.1.js:4
- f.support.ajax.f.ajaxTransport.send.d jquery.1.7.1.js:4

**When it happen**

- For now, it only happen if `MiniProfiler.Settings.PopupShowTrivial = true`. Put it to false and the problem is gone!

- The problem occur because there some html tags missing in the popup. The href tag with the class `toggle-trivial` is missing sometimes and i don’t know why.

---

<div class="post-metadata">

**Author:** ![washcroft](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/washcroft/32/995_2.png) [@washcroft](https://community.miniprofiler.com/u/washcroft)\
**Post date:** [June 12, 2013, 4:47am UTC](https://community.miniprofiler.com/t/cannot-call-method-substr-of-undefined-error/119/2 "2013-06-12T04:47:29Z")

</div>

Same problem here, running latest release. Cannot find exact cause.
