three.js: TypeError: Window.createImageBitmap: 2 is not a valid argument count for any overload.
Sometimes I get this error.
Steps to reproduce the behavior:
- Load a gltf model with r124, Idk
- Look into browser console
- See error
Code
let manager = new THREE.LoadingManager, loader = new GLTFLoader( manager );
...
loader.load( config.path, function( result ) {
// nothing special here
Live example
n/a
Expected behavior
The error never happens
Screenshots
Platform:
- Device: Desktop
- OS: Windows 10
- Browser: Firefox
- Three.js version: r124
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (11 by maintainers)
Commits related to this issue
- Firefox createImageBitmap workaround See mrdoob/three.js#21003 — committed to alienkitty/alien.js by pschroen 3 years ago
FWIW, I have submitted patches to FF to add options support for createImageBitmap. Pending review on latest revision at the moment.
It’s targeted for Firefox 93 due in early October unless it hits problems.
The createImageBitmap patches have now landed in Firefox nightly and the flipY and premulitplyAlpha options are supported. The resize and colorSpaceConversion options aren’t supported yet.
The gl.pixelStorei gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL and gl.UNPACK_FLIP_Y_WEBGL parameters are ignored as per latest spec.
I was using the latest version of GLTFLoader and, inexplicably, a three.js app that was working fine previously on firefox 87.0 hit a snag with this error. I had to force the loader to use THREE.TextureLoader to get everything working again.
a ha @Mugen87 that makes sense now. since FF fakes user agent and pretends to be an iPhone, this fails