Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Invalid Texture Atlas JSON Hash given, missing 'frames' Object

Invalid Texture Atlas JSON Hash given, missing 'frames' Object This message comes from the JSON hash parser in src/textures/parsers/JSONHash.js . The whole check is one guard at the top of the parse: if the JSON has no frames object, the parser logs the error and hands the texture back untouched. Nothing throws. The loader still reports progress, the load still completes, and…

The error message "Invalid Texture Atlas JSON Hash given, missing 'frames' Object" originates from the JSON hash parser located in src/textures/parsers/JSONHash.js. This occurs when the JSON file does not contain a frames object, prompting the parser to log an error and return the texture as is without modification. Although the loading process appears complete, the issue manifests later when attempting to access individual frames by name.

The "untouched" texture, which only includes the base frame ( '__BASE' ), results in sprites drawing the entire sheet within a single cell, causing animations to appear frozen, flickering, or distorted. To reproduce the issue, simply provide a JSON file without a top-level frames object to the load.atlas method. Upon observing the error, inspect the texture's frame names – an absence of any frame names other than "__BASE" confirms the parser's failure.

This error does not stem from using the incorrect format, but rather indicates the absence of a frames key, which is why the message specifically references the hash parser. Multi-atlas exports, generated by different tools, and truncated or substituted files may also cause this error. To prevent such issues, ensure that multi-atlas JSON files follow the correct format, validate the JSON before usage, and include a frame count and image name comparison.

Implementing a build script or manual check to assert the existence of the frames key and verify frame rectangles against the PNG dimensions will help catch broken atlases and avoid shipping faulty textures.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

TypeScript 7.1 Beta: Import Attributes, ES2026 and the API Tool Authors Waited For

TypeScript 7.0 made the headlines for being a native port, and the follow-up beta is where the pieces tool authors were missing start to arrive.

  • TypeScript 7.1 beta introduces import attributes for ambient modules
  • Source phase imports, an ECMAScript 2026 feature, are supported in TypeScript 7.1 beta
  • New API with entry points and snapshots for tooling authors

More from Tuesday, 1 December 2026 →