cuelang/cue

cmd/cue: JSON parse error reports wrong position in file

rogpeppe opened this issue · 1 comments

commit aa61ee7

The error printed when parsing an invalid JSON file isn't tagged with the correct position information.

! exec cue export x.json
stderr 'x\.json:3:5'
-- x.json --
[
  {
    x: 5926
  }
]

The error message that's printed is:

invalid JSON for file "$WORK/x.json": invalid character 'x' looking for beginning of object key string:
    ./x.json:1:1

but the error is not on the first character of the first line.

This issue has been migrated to cue-lang/cue#1017.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.