Switching engines vs createObjectURL

This is happening consistently on my system and chrome incognito browser, Version 136.0.7103.49 (Official Build) (64-bit).

I have Database.IDBStorageEnabled = true, and fire up engine = new Engine(this.viewport, true); for localhost testing. Then I switch to webgpu engine (as per docs), do work, reset and then back to the usual engine.

Now when starting my app, I get the error in console: Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.

It appears the error stems from loading images from cache via _loadImageFromDB at URL.createObjectURL(texture.data);. Is this deprecated?

To resolve, I can either comment out Database.IDBStorageEnabled = true and restart with the usual engine OR close the chrome browser and restart. This does not happen when I DO NOT switch engines. Does webGpu affect cached resources?

Interesting and unexpected behavior. I assume this only happens in chrome, as chrome deprecated this way of creating a URL quite a long time ago, and I wonder why we didn’t catch it so far.
I’ll check later today why it only happens when switching engines as well.

Correct, happened on avif image textures.

More data in case you did not repro. This is what I did, edited my local npm database.js to log texture.data just b4 the offending line.

if (texture && typeof URL === "function") {
    console.log(texture.data);
    blobTextureURL = URL.createObjectURL(texture.data);
  1. Clean start an incognito tab, started my app with engine = new Engine(this.viewport, true)
    Nothing in console, wai
  2. Restart my app, still with glsl engine.
    Console shows Blob {size: 777, type: 'image/avif'}, wai
  3. Switch to webgpu engine.
    Nothing in console?
  4. Switch back to engine = new Engine(this.viewport, true)
    Console show ArrayBuffer(777).

So somewhere between 3 and 4, my image textures went from blobs to buffer. Does this help?

Anything helps, for sure :slight_smile:

I am diving into it right now

Wow, what an interesting issue :slight_smile:

This should fix it

2 Likes