-
Notifications
You must be signed in to change notification settings - Fork 164
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
Failed to execute 'shaderSource' on 'WebGL2RenderingContext': parameter 1 is not of type 'WebGLShader' #408
Comments
A little more context: It happens on React 18 only. Just tested it with a fresh project with React 17 and it's working. It is also failing on everything shader related thing that I tried. Even making a shader program from scratch throws the same error so it's probably not related to the library per se but if @gre or someone with more WebGL experience can check it out it'd be better. |
Mmh curiously the cookbook uses React 18. I will have to recreate a basic example to try to reproduce. |
Was able to pinpoint this issue to this file in |
I think this is related to React 18 Strict Mode. If you create a fresh project with create-react-app and add gl-react and gl-react-dom you can reproduce the issue. If you comment the out strict mode in const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
- <React.StrictMode>
<App />
- </React.StrictMode>
); |
Library Version
I use React 18.
Expected Behavior
This code to render.
Actual behavior
I get the following error:
From my limited debugging, in the
compileShader
The
shader
variable isnull
. Whic gives the error I think.type
is35633
andsrc
isSteps to reproduce the behavior
I tried to implement the first example in the docs. I get this error in Opera, Firefox and Chrome.
The text was updated successfully, but these errors were encountered: