Home / Merged error reference / 73

Atlas JSON missing frames key / wrong export format (Phaser Hash vs Array)

Covers IDs: P07, P08 · Engine: Phaser

P07 · Phaser

Invalid Texture Atlas JSON Hash given, missing 'frames' Object
Verification
源码原文(src/textures/parsers/JSONHash.js:29)
Frequency
未公开

Trigger: The atlas JSON is parsed in Hash format (TexturePacker hash export), but the top-level object has no frames key — for example an Array-format JSON was mistakenly loaded as Hash, or the JSON is truncated or malformed.

Typical cause: The JSONHash parser first checks !json['frames']; if missing it aborts parsing, the texture keeps only the __BASE frame, and all later frame lookups by name fail.

Step-by-step fix:
  1. Confirm the export format matches the loading method (this.load.atlas passes both json and image).
  2. Check the JSON top level contains a frames object.
  3. Use a JSON validator to rule out truncation or escaping errors.

Per-entry sources and capture date are listed at /sources#P07.

P08 · Phaser

Invalid Texture Atlas JSON Array
Verification
源码原文(src/textures/parsers/JSONArray.js:29)
Frequency
未公开

Trigger: The atlas JSON is parsed in Array format, but the top level has neither a frames array nor a textures array: wrong format selected, the file is actually a Hash structure, or the request returned an error page.

Typical cause: The JSONArray parser checks !json['frames'] && !json['textures']; when neither key matches, parsing aborts.

Step-by-step fix:
  1. Verify whether the atlas was exported as Array or Hash.
  2. Confirm the response body is JSON, not a text/html error page.
  3. Check the request status code and body in the browser network panel.

Per-entry sources and capture date are listed at /sources#P08.

Related errors

Need an offline quick-reference checklist?

Atlas error library Pro pack: 123 error references (110 single + 13 merged) plus a quick-fix guide, $19 one-time purchase, delivered as electronic files.

View Pro pack / order