E4212

E4212#

Compiler diagnostic name: invalid_moon_mod_config.

Invalid configuration in moon.mod.json.

moon.mod.json accepts only module-level configuration fields understood by the build system. Unknown or misplaced configuration keys are rejected so that spelling mistakes do not silently change how a module is built.

This error is produced while the build system reads module configuration, before ordinary moon check diagnostic rendering is available, so it is not monitored by a source-level error-code example.

Erroneous example#

{"name": "moonbit-community/example", "invalid-config": true}

The invalid-config field is not a valid module configuration key.

Suggestion#

Remove the invalid field, or move package-level configuration to moon.pkg.

{"name": "moonbit-community/example"}