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

Cannot read properties of null (reading 'enable') - When hardware acceleration is disabled #70

Open
Mayank-Sh07 opened this issue Apr 12, 2023 · 2 comments

Comments

@Mayank-Sh07
Copy link

image

@szilarddoro
Copy link

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).

@Kinbaum
Copy link

Kinbaum commented Nov 9, 2023

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

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

3 participants