regl-project / regl

👑 Functional WebGL
MIT License
5.19k stars 320 forks source link

Shader compile error is not helpful #463

Open Boscop opened 6 years ago

Boscop commented 6 years ago

image https://github.com/regl-project/regl/blob/8f26f111a913cd9f7f239ebcdf691189e82c7a5f/lib/util/check.js#L300 https://github.com/regl-project/regl/blob/8f26f111a913cd9f7f239ebcdf691189e82c7a5f/lib/util/check.js#L211

It should show the actual error with line number in the shader source.

This fragment shader is working in chrome but not in IE11 (others are working in IE11), I'm trying to find out why..

Boscop commented 6 years ago

Now that I got the fragment shader compiling, it's not linking, again, the error is not helpful :/ image

rreusser commented 6 years ago

Do other browsers report the errors normally using the same setup? (Details here: Error messages and debug mode)

I think console.log is one of those weird JS things that's not exactly a normal function so that maybe console.log.apply could somehow be weird in IE, though that's a total guess.

Boscop commented 6 years ago

It's working without errors in other browsers like FF and Chrome

rreusser commented 6 years ago

If there is an error though, do other browsers report it correctly/usefully?

Boscop commented 6 years ago

What kind of error? You mean when compiling the shader? They just report the error that this lib throws, with the "unknown" location..

rreusser commented 6 years ago

So to clarify, other browsers throw errors in the same unhelpful manner when there is an error? That would suggest that maybe you're using the unchecked version of regl. Are you using browserify? Browserify with debug mode enabled? Webpack?