{"record":{"id":"d252d70e0c237981","repo":"gchq/CyberChef","slug":"failed-to-hydrate-operation-o-name-err","errorCode":null,"errorMessage":"Failed to hydrate operation '${o.name}': ${err}","messagePattern":"Failed to hydrate operation '(.+?)': (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/Recipe.mjs","lineNumber":80,"sourceCode":"        if (!modules) {\n            // Using Webpack Magic Comments to force the dynamic import to be included in the main chunk\n            // https://webpack.js.org/api/module-methods/\n            modules = await import(/* webpackMode: \"eager\" */ \"./config/modules/OpModules.mjs\");\n            modules = modules.default;\n        }\n\n        this.opList = this.opList.map(o => {\n            if (o instanceof Operation) {\n                return o;\n            } else {\n                try {\n                    const op = new modules[o.module][o.name]();\n                    op.ingValues = o.ingValues;\n                    op.breakpoint = o.breakpoint;\n                    op.disabled = o.disabled;\n                    return op;\n                } catch (err) {\n                    throw new Error(`Failed to hydrate operation '${o.name}': ${err}`);\n                }\n            }\n        });\n    }\n\n\n    /**\n     * Returns the value of the Recipe as it should be displayed in a recipe config.\n     *\n     * @returns {Object[]}\n     */\n    get config() {\n        return this.opList.map(op => ({\n            op: op.name,\n            args: op.ingValues,\n        }));\n    }\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/gchq/CyberChef/blob/4290ea753912378913b1f3f54e0fc5720afeda5d/src/core/Recipe.mjs#L62-L98","documentation":"Thrown by Recipe._hydrateOpList() (line 80) wrapping any exception from constructing an operation instance (new modules[o.module][o.name]()) or from assigning op.ingValues. Notably this throws a plain Error, NOT OperationError. The most common inner cause is operation-not-found: modules[o.module][o.name] is undefined when the recipe references an op name/module that does not exist, so calling it as a constructor throws TypeError. The second cause is an ingValues failure (error 14) wrapped again here.","triggerScenarios":"A recipe entry references an operation name that was renamed/removed (e.g. 'From_Base64' vs 'From Base64'); the module key is wrong or missing; the operation exists but one of its args is invalid, so op.ingValues = o.ingValues throws error 14 which gets wrapped here.","commonSituations":"Loading a recipe saved against an older or newer CyberChef version where an operation was renamed; hand-written recipe JSON with a typo in the op name or module; recipe references a custom operation whose module was not registered.","solutions":["Read the inner ${err}: 'modules[...][...] is not a constructor' / 'undefined is not a constructor' means the op name or module is wrong - verify against the current operation catalogue.","Operation names in recipes use spaces, not underscores; confirm spelling and capitalisation.","If the inner error is an OperationError about an ingredient, fix that arg (see error 14).","Ensure any custom operation is registered in the module tree before hydrating the recipe."],"exampleFix":"// before - wrong op name\nrecipe = [{ op: 'From_Base64', args: [], module: 'Default' }];\n\n// after\nrecipe = [{ op: 'From Base64', args: [], module: 'Default' }];","handlingStrategy":"validation","validationCode":"import OperationList from './core/config/OperationList.mjs';\nconst known = new Set(OperationList.map(o => o.op));\nfunction validateRecipeOps(recipe) {\n  for (const r of recipe) if (!known.has(r.op)) throw new Error(`Unknown op: ${r.op}`);\n}","typeGuard":"function opExists(name, modules): boolean { return !!(modules && modules.Default && typeof modules.Default[name] === 'function'); }","tryCatchPattern":"try { await recipe._hydrateOpList(); } catch (e) {\n  if (/Failed to hydrate operation/.test(e.message)) { /* name/module wrong or arg invalid */ }\n}","preventionTips":["Use the exact current operation display name (spaces, not underscores).","Validate recipe op names against OperationList before hydration.","Re-save recipes after upgrading CyberChef versions."],"tags":["recipe","hydration","operation-not-found","error"],"backgroundTag":null,"analyzedSha":"4290ea753912378913b1f3f54e0fc5720afeda5d","analyzedAt":"2026-08-13T06:05:50.210Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}