Giter VIP home page Giter VIP logo

Comments (2)

szilarddoro avatar szilarddoro commented on May 14, 2024

I encountered the same issue when I disabled WebGL. You can wrap your component in an ErrorBoundary and provide a fallback (e.g., a static globe image).

from cobe.

Kinbaum avatar Kinbaum commented on May 14, 2024

I have a strange behavior that I've noticed with this library and I'm wondering if either of you or if @shuding can help resolve this. When hardware acceleration is disabled, I run into this error as well. In order to fix that, I introduced a little logic to check if webgl is supported:

useEffect(() => {
  try {
      const canvas = document.createElement('canvas');
      const context = canvas.getContext('webgl') || canvas.getContext('experimental-webgl') as WebGLRenderingContext;
  
      context.getSupportedExtensions();
  }
  catch (err) {
      setIsWebGlSupported(false);
      console.log('WebGL not supported, hiding globe animation...');
  }
  }, []);

I then conditionally render the globe based on isWebGlSupported
I'm using an M2 mac with macOS 13.5 and I tested this in Chrome and Edge and the logic check I have behaves as I would expect.

Now I've have seen an issue with this on a colleague's machine where they've disabled hardware acceleration, but instead of context.getSupportedExtensions() throwing an error, it returns a value.

The globe itself then renders completely black.

I was able to replicate the behavior in saucelabs.
Heres's a screenshot from https://upstash.com which also uses this lib.

Screenshot 2023-11-09 at 2 44 42 PM

from cobe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.