question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EXGL: gl.pixelStorei() doesn't support this parameter yet!

See original GitHub issue

🐛 Bug Report

Summary of Issue

Randomly using SDK 39 ("expo-gl: ~9.1.1", "expo-gl-cpp": "~9.1.2") I get the above error in my production app (non-simulator. I do not use any special configuration. I wish I had more information.

Sentry error produced: TypeError: undefined is not an object (evaluating 't.__exglCtxId=n')

Environment - output of expo diagnostics & the platform(s) you’re targeting

I have a production app on IOS & Android, however this only breaks on IOS with SDK 39. This error has never occured before SDK 39, and has occurred only on IOS for all IOS versions. Out of hundreds of people who use the app each day (and this feature), only ~1% crash. I cannot reproduce in a simulator.

Expo CLI 3.28.2 environment info:
    System:
      OS: macOS 11.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.5 - ~/.nvm/versions/node/v12.18.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.9.1 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5977832
      Xcode: 12.2/12B45b - /usr/bin/xcodebuild
    npmPackages:
      expo: ^39.0.0 => 39.0.4 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2 
    Expo Workflow: managed

Reproducible Demo

I cannot reliably reproduce it, although the only code for expo pixi in my app is:

<ExpoPixi.Sketch
     style={expoStyle}
     strokeColor="black"
     strokeWidth={9}
     strokeAlpha={1}
     ref={sketchRef}
     initialLines={initialLines(width, height, ratio)}
/>

Expected Behavior vs Actual Behavior

Not crash

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
YarooqHcommented, Dec 2, 2022

Just add these lines to your Canvas tag

onCreated={(state) => { const _gl = state.gl.getContext() const pixelStorei = _gl.pixelStorei.bind(_gl) _gl.pixelStorei = function(...args) { const [parameter] = args switch(parameter) { case _gl.UNPACK_FLIP_Y_WEBGL: return pixelStorei(...args) } } }}

After Adding your Canvas should look something like this.

<Canvas gl={{ physicallyCorrectLights: true }} camera={{ position: [-6, 0, 16], fov: 36 }} onCreated={(state) => { const _gl = state.gl.getContext() const pixelStorei = _gl.pixelStorei.bind(_gl) _gl.pixelStorei = function(...args) { const [parameter] = args switch(parameter) { case _gl.UNPACK_FLIP_Y_WEBGL: return pixelStorei(...args) } } }}></Canvas>

0reactions
github-actions[bot]commented, Feb 10, 2022

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebGLRenderingContext.pixelStorei() - Web APIs | MDN
Pixel storage parameters​​ Unpacking of pixel data from memory. Flips the source data along its vertical axis if true.
Read more >
EXGLNativeMethods.cpp - UNPKG
pixelStorei() doesn't support this parameter yet ! ... Nothing worked... throw std::runtime_error("EXGL: Invalid pixel data argument for gl.
Read more >
GLView - Expo Documentation
expo-gl provides a View that acts as an OpenGL ES render target, useful for rendering 2D ... It's supported only on Android and...
Read more >
Uncaught Error: EXGL: Invalid pixel data argment for gl ...
I've built up an expo react-native project using Pixi js. The project is running well on the Expo platform, but after building the...
Read more >
WebGLRenderingContext.pixelStorei - Web APIs - W3cubDocs
Pixel storage parameters ; gl.PACK_SKIP_PIXELS, Number of pixel locations skipped before the first pixel is written into memory. GLint, 0, 0 to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found