Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THREE.WebGLRenderer: Error creating WebGL context. #185

Open
time-to-beem opened this issue Oct 5, 2023 · 0 comments
Open

THREE.WebGLRenderer: Error creating WebGL context. #185

time-to-beem opened this issue Oct 5, 2023 · 0 comments

Comments

@time-to-beem
Copy link

time-to-beem commented Oct 5, 2023

We are using ifc.js for one year in our application.

We have a bug since the beginning. It is a hard one to solve. It only happens sometimes after we update our application. When a user open an ifc file, the following code:

      this.viewer = new IfcViewerAPI({
        container: this.container,
        backgroundColor: new Color(0xffffff),
      })

this.container: <div id=​"viewer-container" style=​"top:​ auto;​ left:​ auto;​ display:​ block;​ outline:​ none;​ border-radius:​ 4px;​ border:​ 1px solid rgba(0, 0, 0, 0.12)​;​ background-color:​ white;​ width:​ 100%;​ height:​ 100%;​ min-height:​ 500px;​">​</div>​

throws the error: "THREE.WebGLRenderer: Error creating WebGL context.".

One solution to solve this is to tell the user cleaning all the app data and to refresh the page.

I opened an issue in the Discord channel this summer. But I don't have access anymore. So I open it again here.

It happen on different computer and browsers. So it is not a material issue and does not seem to be a material issue.
From what I saw on the internet, it may come from "WebGL Context Limit" or maybe "If you're using OffscreenCanvas in a Worker, make sure it's supported in your target browsers."

We started with "web-ifc-viewer": "^1.0.214" and now we use "web-ifc-viewer": "^1.0.216".

Even if the bug seems to depend on the data of my application, it seems to happen because ifc.js does not handle webGL correctly, especially the "context limit", it should never be reached, or at least throw a clear error message explaining if it comes from the ifc model or from loading to many models at the same time...

I can't find the difference between what I give to the ifc viewer when it crashes and when it doesn't.
I think there was more information in the issue opened on the discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant