# Error after calling WebViewer::shutdown method and opening a new view

**URL:** <https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135>\
**Category:** HOOPS Visualize Web\
**Tags:** webviewer\
**Created:** [October 21, 2024, 3:04am UTC](https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135 "2024-10-21T03:04:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/zak/32/1678_2.png) [@zak](https://forum.techsoft3d.com/u/zak)\
**Post date:** [October 21, 2024, 3:04am UTC](https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135/1 "2024-10-21T03:04:18Z")

</div>

I have an angular application using hoops webviewer, and when I try to clean up the viewer when I destroy the component I get the following error when creating a new component with a new view:

```auto
chunk-TWWAJFRB.js?v=b86aec02:68 Rejected promise in '_sessionStarted' callback: TypeError: Cannot set properties of undefined (setting 'width')
    at rb._resizeRenderCanvas (hoops-web-viewer.mjs:41108:11)
    at rb.resize (hoops-web-viewer.mjs:41100:128)
    at rb.setAllowHighDpi (hoops-web-viewer.mjs:41284:37)
    at rb.<anonymous> (hoops-web-viewer.mjs:40484:10)
    at Generator.next (<anonymous>)
    at chunk-TWWAJFRB.js?v=b86aec02:74:61
    at ZoneAwarePromise (zone.js:2702:25)
    at __async (chunk-TWWAJFRB.js?v=b86aec02:58:10)
    at rb._onSessionStarted (hoops-web-viewer.mjs:40483:29)
    at _sessionStarted (hoops-web-viewer.mjs:40245:39)

```

Digging a little into the hoops code, I can see that on the first load, the value of `._sc.canvas` is an OffscreenCanvas, but on the second load after destroy it is `undefined`, causing this issue.

Any help much appreciated 🙂

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [October 21, 2024, 11:31am UTC](https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135/2 "2024-10-21T11:31:50Z")

</div>

Hello @zak,

Welcome to the forum!

The issue you described has previously been reported. I can tell you that it has been escalated to our engineering team and the investigation is ongoing.

Thanks,  
Tino

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/zak/32/1678_2.png) [@zak](https://forum.techsoft3d.com/u/zak)\
**Post date:** [November 24, 2024, 5:15pm UTC](https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135/3 "2024-11-24T17:15:23Z")

</div>

Thanks Tino,

Is there any progress on the investigation into this issue? If not I’ll start looking into alternative workarounds like detaching the viewer when the page is unloaded and reattaching it on return navigation to avoid it ever being destroyed. This would be an unfortunate hack if necessary.

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [November 24, 2024, 6:55pm UTC](https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135/4 "2024-11-24T18:55:42Z")

</div>

Hello @zak,

The fix for this issue is slated to be included in the next Communicator release — which is HC 2024.8.0 (with a forecasted release date of November 26, 2024).

Thanks,  
Tino

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/zak/32/1678_2.png) [@zak](https://forum.techsoft3d.com/u/zak)\
**Post date:** [December 3, 2024, 2:00am UTC](https://forum.techsoft3d.com/t/error-after-calling-webviewer-shutdown-method-and-opening-a-new-view/4135/5 "2024-12-03T02:00:05Z")

</div>

Thanks @tino, confirmed this issue no longer occurs in 2024.8.0
