WebGL errors in Safari 11.1.2 - RangeError: Maximum call stack size exceeded

Using Unity 2017.4.7f1 I’m getting an error on opening a WebGL project in Safari on a Mac.

RangeError: Maximum call stack size exceeded.

WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
WebGL: ERROR: 0:53: ‘[ ]’ : Index expression must be constant

If I open it in the Safari technology preview - version 12 it’s fine.

Anyone else getting this?

Same project works fine in Chrome, Edge, and Firefox

Bizarrely this morning it has fixed itself… huh.

Getting same issue, latest 2017 LTS release - bug?
Happens on both safari 12 & 13 though may not break player, just spits out to console

Not seen the issue again for a long time, but I’m now using 2018.3.14 as my standard Unity version

Build for only WebGL 1.0, set code stripping to medium or low and reimport all.

The errors aren’t relevant.

The error

RangeError: Maximum call stack size exceeded.

may be due to running Development build, unoptimized build or a too large build that Safari cannot handle. If the error shows a call stack, it would be good to check out.

The error

WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL

is due to Safari bug 169999 – texImage2D for a half-float texture only accepts null. To work around this manually, you can edit the file library_gl.js inside Unity installation, and apply the following patch:

https://github.com/emscripten-core/emscripten/pull/9174/files

(though set GL_DISABLE_HALF_FLOAT_EXTENSION_IF_BROKEN=1 in the file src/settings.js)

The error

WebGL: ERROR: 0:53: ‘[ ]’ : Index expression must be constant

looks like something different that I have not seen before. If this appears in isolation without the other errors present, please open a bug report with a test case!

Ok thanks jukka. Safari is not good for webgl [& unity]. What with bugs and the way the browser complains about memory & energy use!
Maybe a blog post about Unity’s views on this would be good!