cue-lang/cue

cmd/cue: JSON syntax error does not point to erroneous line

Closed this issue · 0 comments

What version of CUE are you using (cue version)?

v0.9.2

Does this issue reproduce with the latest stable release?

Yes (and it also reproduces as early as v0.4.3)

What did you do?

! exec cue export x.json
stderr 'schema.json:[34]:'
-- x.json --
{
  "foo": true,
  "bar": 2
  "baz": false
}

What did you expect to see?

A passing test. The syntax error (the missing comma on line 3) should be reported near the line that it occurred.

What did you see instead?

> ! exec cue export x.json
[stderr]
invalid JSON for file "$WORK/x.json": invalid character '"' after object key:value pair:
    ./x.json:1:1
[exit status 1]
> stderr 'schema.json:[34]:'
FAIL: /tmp/testscript2610835852/y.txtar/script.txtar:2: no match for `schema.json:[34]:` found in stderr

The error is reported at line 1, so gives no hint as to where the error is located.