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/x18n2003The 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.
- Make sure that the top level of the file is an object, not an array or a string.
- If the file is not a locale file, change
resourcesso that its pattern does not match the file.
Exit code
The CLI exits with code 1.