3

I am getting error like: Uncaught TypeError: Cannot read property '__webglFramebuffer' of null

when i am going to another page linked with the page which has autodesk viewer attached . I dont know why it is coming . I am using angularjs for my web site and there is no code in controller of that page about viewer.

6
  • which version are you using? Commented Jul 28, 2017 at 22:18
  • I am using:<script src="developer.api.autodesk.com/viewingservice/v1/viewers/….*"></script> <script src="developer.api.autodesk.com/viewingservice/v1/viewers/….*"></script> Commented Jul 29, 2017 at 1:53
  • thanks, I would first recommend using a newer version, we're currently on 2.15, and will investigate this issue. Commented Jul 31, 2017 at 12:29
  • I think the problem is with api calls . On every page there is script and link tab for api. Commented Aug 1, 2017 at 16:42
  • I am using 2.15 version, still getting same error. Commented Aug 4, 2017 at 15:39

1 Answer 1

5

You are getting this error because you do not destroy the viewer instance on the page you left, so when receiving event such as page resize the viewer will try to re-render and since the WebGL context has been destroyed it will fire this error.

Simply place some cleanup handler called when you navigate away from the viewer page, depending on which version of angular you are using you should find how to that easily, then place following code to cleanup the viewer:

// assumes this.viewer contains your viewer, your code might be different ...
// make sure viewer has been created
if (this.viewer) {

  // I added this to handle some specific cases
  if(this.viewer.impl.selector) {

    this.viewer.tearDown()
    this.viewer.finish()
    this.viewer = null
  }
} 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.