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:
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