These are chat archives for canjs/canjs

14th
Dec 2018
Gregg Roemhildt
@roemhildtg
Dec 14 2018 13:41
Anyone have any debugging tips for troubleshooting this error? Chrome freezes up with Paused before potential out of memory crash and then this happens a couple of minutes later:
image.png
Manuel Mujica
@m-mujica
Dec 14 2018 15:56
@roemhildtg do you have can-debug installed? I wonder if doing something like this https://canjs.com/doc/guides/debugging.html#Debugwhatcausedaobservableeventorupdatetohappen_ could help you figure out if you have some sort of binding-cycle.
can.queues.logStack(); might help you figure out why that code keeps executing... There are other debugging tips in that guide as well.
Gregg Roemhildt
@roemhildtg
Dec 14 2018 16:05
I can't get that to run once this happens. It's like the whole browser is locked up
Manuel Mujica
@m-mujica
Dec 14 2018 16:08
Screen Shot 2018-12-14 at 9.06.33 AM.png
hmm I see. One thing I've done when stuff like that happens is, since it's likely you have a code path executing in a cycle... Before the browser dies, you can pause the code execution.
sometimes the stack trace helps me figure out what's going on.
Gregg Roemhildt
@roemhildtg
Dec 14 2018 16:12
Yeah, that pause button doesn't become available in this case. Whatever's causing this appears to be locking up the browser immediately perhaps a loop with a memory leak that immediately allocates all of the available memory?
Manuel Mujica
@m-mujica
Dec 14 2018 16:13
well, then I would start commenting out code... in there is a specific template you're rendering, try removing components and see if that makes the problem go away.
Gregg Roemhildt
@roemhildtg
Dec 14 2018 16:20
Yeah Ill start looking into it that way
Gregg Roemhildt
@roemhildtg
Dec 14 2018 18:47
Okay, I've narrowed down the issue
Its a partial that has a let helper used
{{let url = object.attributes[field.name]}}
{{#if(url)}}
<a href="{{#if(field.urlPrefix)}}{{field.urlPrefix}}{{/if}}{{url}}{{#if(field.urlSuffix)}}{{field.urlSuffix}}{{/if}}" 
    target="_blank">
    <i class="{{#if(field.iconClass}}{{field.iconClass}}{{else}}fa fa-external-link{{/if}}"></i>
    {{#if(field.linkText)}}{{field.linkText}}{{else}}Link{{/if}}
</a>
{{else}}
<p>None</p>
{{/if}}
It renders fine the first time, but when object changes it freezes up
It actually renders fine the first time object changes, but the second time it freezes up