Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

ASSET_PARSE

Package @dioramajs/diorama/assets Level error

An asset downloaded, but its content could not be decoded or parsed, so its lease rejected.

View as Markdown
On this page
ASSET_PARSE: cannot decode {url}

Why it happens

  • An image loaded, but decode() or createImageBitmap() failed: the file is broken, or the browser does not support its format.
  • A .glb or .gltf file is not glTF: {url} is not glTF. A server that answers a missing file with an HTML page and status 200, such as a single-page app fallback, causes this.
  • The three.js loader threw while it parsed a model or a KTX2 texture: cannot parse {url}. When the error looks like a refused worker or WebAssembly, the code is ASSET_DECODER instead.
  • A json asset is not valid JSON: {url} is not JSON.
  • An own loader threw an error that is not an AssetError. Diorama wraps it with this code and the error text as the message.

Like ASSET_LOAD, the error is reported once per attempt with the target asset:<url>, and the lease’s ready rejects.

How to fix

  1. Open the URL from the message in the browser and check that the response is the file, not an HTML page.
  2. Check the cause in the console for the decoder or parser message.
  3. Export the file again from its source tool, or convert the image to a format your target browsers decode.