X18N0002: Config file could not be loaded

Config file could not be loaded. Fix the syntax error, or run `x18n doctor` for details.

Message

[X18N0002] Config file could not be loaded <detail>
├▶ fix: Fix the syntax error, or run `x18n doctor` for details.
╰▶ see: https://x18n.antfu.dev/errors/x18n0002

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

x18n found a config file, but it failed to run or read it. The message holds the error from the loader.

  1. Fix the syntax error that the message names.
  2. Make sure that a TS or JS config has a default export, for example export default defineConfig({ ... }).
  3. Run x18n doctor to see which config file x18n picked.

Exit code

The CLI exits with code 2.

Source