# Canjs4: crashes calling helpers withing partialName stache

**URL:** <https://forums.bitovi.com/t/canjs4-crashes-calling-helpers-withing-partialname-stache/913>\
**Category:** CanJS\
**Created:** [June 14, 2018, 7:42am UTC](https://forums.bitovi.com/t/canjs4-crashes-calling-helpers-withing-partialname-stache/913 "2018-06-14T07:42:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sronsiek](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sronsiek](https://forums.bitovi.com/u/sronsiek)\
**Post date:** [June 14, 2018, 7:42am UTC](https://forums.bitovi.com/t/canjs4-crashes-calling-helpers-withing-partialname-stache/913/1 "2018-06-14T07:42:28Z")

</div>

I’d like to describe what seems like a bug to me, maybe someone can explain, maybe a bug report should follow. We’re using canjs4 + stealjs on linux.

> {{\<componentPartial}}  
> {{#is(scope.root.currentPage(), ‘some\_page\_name’)}}   
>   
> {{else}}  
>   
> {{/is}}  
> {{/componentPartial}}
> 
> {{#constructor.pageData[currentPage()]}}  
> {{\>componentPartial}}  
> {{/constructor.pageData}}

When using #is or #switch constructs within the named partial feature ([{{\<partialName}} | can-stache | Views | API Docs | CanJS](https://canjs.com/doc/can-stache.tags.named-partial.html)), AND one of the args is a function call, this causes crashes & reloads of our app.

When replacing the function call in the #is / #switch with a variable there are no crashes.  
When moving the code (with function calls in #is / #switch) from the named partial to the #constructor … part, ie eliminating the use of the named partial, no crashes occur.

Here’s the error stack when crashes occur:

> VM2159251 node.js:77 Uncaught DOMException: Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of this node.  
> at HTMLElement.normal.(anonymous function) (http:///node\_modules/can-dom-mutate/node.js:77:27)  
> at Object.remove (http:///node\_modules/can-view-nodelist/can-view-nodelist.js:485:26)  
> at Object.replace (http:///node\_modules/can-view-nodelist/can-view-nodelist.js:464:14)  
> at CompletionQueue.flush (http:///node\_modules/can-queues/completion-queue.js:22:12)  
> at Object.onComplete (http:///node\_modules/can-queues/can-queues.js:44:16)  
> at PriorityQueue.flush (http:///node\_modules/can-queues/priority-queue.js:120:19)  
> at Object.onComplete (http:///node\_modules/can-queues/can-queues.js:30:16)  
> at Queue.flush (http:///node\_modules/can-queues/queue.js:55:17)  
> at Object.stop (http:///node\_modules/can-queues/can-queues.js:92:19)  
> at PushstateObservable.can-route.updateRouteData (http:///node\_modules/can-route/can-route.js:98:15)  
> normal.(anonymous function) @ VM2159251 node.js:77  
> remove @ VM2159261 can-view-nodelist.js:485  
> replace @ VM2159261 can-view-nodelist.js:464  
> CompletionQueue.flush @ VM2159280 completion-queue.js:22  
> onComplete @ VM2159274 can-queues.js:44  
> PriorityQueue.flush @ VM2159279 priority-queue.js:120  
> onComplete @ VM2159274 can-queues.js:30  
> Queue.flush @ VM2159276 queue.js:55  
> stop @ VM2159274 can-queues.js:92  
> can-route.updateRouteData @ VM2159411 can-route.js:98  
> Queue.flush @ VM2159276 queue.js:51  
> onComplete @ VM2159274 can-queues.js:53  
> CompletionQueue.flush @ VM2159280 completion-queue.js:27  
> onComplete @ VM2159274 can-queues.js:44  
> PriorityQueue.flush @ VM2159279 priority-queue.js:120  
> onComplete @ VM2159274 can-queues.js:30  
> Queue.flush @ VM2159276 queue.js:55  
> stop @ VM2159274 can-queues.js:92  
> enqueueByQueue @ VM2159274 can-queues.js:126  
> dispatchHandlers @ VM2159410 can-route-pushstate.js:130  
> window.history.(anonymous function) @ VM2159410 can-route-pushstate.js:221  
> anchorClickHandler @ VM2159410 can-route-pushstate.js:187  
> PushstateObservable.anchorClickHandler @ VM2159410 can-route-pushstate.js:74  
> (anonymous) @ VM2159298 -make-delegate-event-tree.js:33  
> (anonymous) @ VM2159298 -make-delegate-event-tree.js:32  
> (anonymous) @ VM2159246 shape.js:446  
> eachListLike @ VM2159246 shape.js:377  
> eachIndex @ VM2159246 shape.js:339  
> eachKey @ VM2159246 shape.js:444  
> each @ VM2159246 shape.js:310  
> handler.delegated.(anonymous function) @ VM2159298 -make-delegate-event-tree.js:24  
> VM2159041 panel-beam-coverage-viewmodel.js!eval:29 inserted panel-beam-coverage  
> VM2159041 panel-beam-coverage-viewmodel.js!eval:87 rendering panel-beam-coverage globe…  
> VM2159041 panel-beam-coverage-viewmodel.js!eval:99 75 2427 231 829

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [June 14, 2018, 11:53am UTC](https://forums.bitovi.com/t/canjs4-crashes-calling-helpers-withing-partialname-stache/913/2 "2018-06-14T11:53:08Z")

</div>

Please update your dependencies to latest. I recently fixed this.

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [June 14, 2018, 11:54am UTC](https://forums.bitovi.com/t/canjs4-crashes-calling-helpers-withing-partialname-stache/913/3 "2018-06-14T11:54:13Z")

</div>

[https://github.com/canjs/can-stache/issues/542](https://github.com/canjs/can-stache/issues/542)
