{"record":{"id":"8d0c94d69e66f8d9","repo":"avajs/ava","slug":"encountered-ava-property-in-fileforerrormessag","errorCode":null,"errorMessage":"Encountered ’ava’ property in ${fileForErrorMessage}; avoid wrapping the configuration","messagePattern":"Encountered ’ava’ property in (.+?); avoid wrapping the configuration","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/load-config.js","lineNumber":151,"sourceCode":"\t\t\tpackageConf = {};\n\t\t} else if (Object.keys(packageConf).length > 0) {\n\t\t\tthrow new Error(`Conflicting configuration in ${fileForErrorMessage} and package.json`);\n\t\t}\n\n\t\tif (!isPlainObject(fileConf) && typeof fileConf !== 'function') {\n\t\t\tthrow new TypeError(`${fileForErrorMessage} must export a plain object or factory function`);\n\t\t}\n\n\t\tif (typeof fileConf === 'function') {\n\t\t\tfileConf = await fileConf({projectDir});\n\n\t\t\tif (!isPlainObject(fileConf)) {\n\t\t\t\tthrow new TypeError(`Factory method exported by ${fileForErrorMessage} must return a plain object`);\n\t\t\t}\n\t\t}\n\n\t\tif ('ava' in fileConf) {\n\t\t\tthrow new Error(`Encountered ’ava’ property in ${fileForErrorMessage}; avoid wrapping the configuration`);\n\t\t}\n\t}\n\n\tconst config = {\n\t\t...defaults, nonSemVerExperiments: {}, ...fileConf, ...packageConf, projectDir, configFile,\n\t};\n\n\tif (\n\t\t'filterNodeArgumentsForWorkerThreads' in config\n\t\t&& typeof config.filterNodeArgumentsForWorkerThreads !== 'function'\n\t) {\n\t\tthrow new Error(`filterNodeArgumentsForWorkerThreads from ${fileForErrorMessage} must be a function`);\n\t}\n\n\tconst {nonSemVerExperiments: experiments} = config;\n\tif (!isPlainObject(experiments)) {\n\t\tthrow new Error(`nonSemVerExperiments from ${fileForErrorMessage} must be an object`);\n\t}","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/load-config.js#L133-L169","documentation":"Guard in loadConfig: the config file contains an 'ava' key, indicating the configuration was wrapped to mimic the package.json style where AVA config lives under an 'ava' property. Standalone config files must export the configuration at the top level; the 'ava' property is the erroneous input.","triggerScenarios":"Thrown at lib/load-config.js:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Unwrap the config: move the contents of the 'ava' object to the top level of the export","Use the 'ava' nesting only inside package.json, not in ava.config.js/mjs","Rename unrelated 'ava' keys in your config if they were intentional data"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bbfd946322fdeca2b547a691d947fb4e18c0c67f","analyzedAt":"2026-09-02T01:24:43.834Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}