X18N2003: Resource is not an object of messages

Resource is not an object of messages. Locale files hold nested objects of strings, numbers, booleans or null.

Message

[X18N2003] Resource is not an object of messages <detail>
├▶ fix: Locale files hold nested objects of strings, numbers, booleans or null.
╰▶ see: https://x18n.antfu.dev/errors/x18n2003

The CLI prints the code and why the error happened, with details such as a file name or a field. The fix and a link to this page follow. With --json, the same parts are in errors of the envelope.

What to do

A locale file parsed, but its top level is not an object of messages. A locale file holds nested objects whose leaves are strings, numbers, booleans or null.

  1. Make sure that the top level of the file is an object, not an array or a string.
  2. If the file is not a locale file, change resources so that its pattern does not match the file.

Exit code

The CLI exits with code 1.

Source