Search code examples
javascriptangularautodesk-viewer

Can't access property "__webglFramebuffer"


If we start the Viewer, but a navigation happens in between, we have the following problem.

Forge Viewer Error

This would be not such a problem if it would not log it only once, but it seems there is some kind of loop, and we are getting a lot of those errors. Also, it impacts the browser performance as well.

The following message also gets printed, but I would not know how we can avoid that leak. Leaking viewer instance error message

This seems to happen from the Version 7.90.0 onwards. With the Version 7.89.0 we would get the following error:

Forge Viewer Error 7.89.0

But this error gets logged only once, and we experienced no performance issues.

Will there be fix in some upcoming versions, or how could we tackle this issue?

Steps to reproduce:

  1. Start up a viewer instance
  2. Quickly navigate back
  3. Wait for errors in console

Update

We already call the folllowing functions on the ngDestroyHook:

  • viewer.tearDown()
  • viewer.current?.uninitialize()
  • this.viewer.finish()
  • Autodesk.Viewing.shutdown();

Solution

  • Make sure you access the viewer only until the component isn't destroyed. In our case, we made some async initializing and destroyed the component before the initializing has been done.