Skip to content

migrate unified aborts the whole project with UnexpectedEndOfInput when a file ends in collapsed closing braces (}}) #337

Description

@apotema

Symptom

On CLI v1.60.1:

$ labelle migrate unified --dry-run
labelle migrate unified: failed on project '.': UnexpectedEndOfInput

No file name, no line — and the entire migration aborts on the first bad file.

Minimal repro

A project containing this single prefab (valid JSONC — python json.loads accepts it after comment stripping, and the engine loads it fine):

{
  "children": [ { "Position": { "x": 0, "y": 0 } } ],
  "components": { "rooms__Room": { "room_type": "x" } }}

UnexpectedEndOfInput.

The identical content with the final closers split onto their own lines parses fine:

  "components": { "rooms__Room": { "room_type": "x" } }
}

Bisect results (each variant tested in isolation): leading comments — fine; comments inside arrays — fine; newline-split ] + , — irrelevant. The trigger is exactly two or more } collapsed on the final line (}} / }}}).

Impact

flying-platform-labelle has 30 files ending this way (every hand-written room prefab), so migrate unified is unusable on the project: one cosmetic formatting habit blocks the whole engine-2.x migration path the error message of engine v2.0's rejectLegacyAliases explicitly directs users to ("Run labelle migrate unified to convert this file").

Expected

  • The migrator's parser accepts anything the engine's jsonc parser accepts.
  • On a parse failure, report the offending file path and continue with the remaining files instead of aborting the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions