{"record":{"id":"871c07c4dfc672cd","repo":"avajs/ava","slug":"filternodeargumentsforworkerthreads-from-filefor","errorCode":null,"errorMessage":"filterNodeArgumentsForWorkerThreads from ${fileForErrorMessage} must be a function","messagePattern":"filterNodeArgumentsForWorkerThreads from (.+?) must be a function","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/load-config.js","lineNumber":163,"sourceCode":"\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}\n\n\tfor (const key of Object.keys(experiments)) {\n\t\tif (!EXPERIMENTS.has(key)) {\n\t\t\tthrow new Error(`nonSemVerExperiments.${key} from ${fileForErrorMessage} is not a supported experiment`);\n\t\t}\n\t}\n\n\treturn {config, unsupportedFiles};\n}\n","sourceCodeStart":145,"sourceCodeEnd":179,"githubUrl":"https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/load-config.js#L145-L179","documentation":"Guard in loadConfig: after merging defaults, file config, and package.json config, config.filterNodeArgumentsForWorkerThreads exists but is not a function. This hook filters Node arguments for worker threads; a non-function (string, boolean, or typo-derived value) was supplied. The input at fault is that merged property.","triggerScenarios":"Thrown at lib/load-config.js:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Define it as a function: module.exports = {filterNodeArgumentsForWorkerThreads: args => args.filter(...)}","Remove the key if you do not intend to filter node arguments","Check for typos or a value copied from a string-based config format"],"exampleFix":null,"handlingStrategy":"type-guard","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"}