{"record":{"id":"9d4b7879946cbd03","repo":"gchq/CyberChef","slug":"sorry-the-name-operation-is-not-available-in-t","errorCode":null,"errorMessage":"Sorry, the ${name} operation is not available in the Node.js version of CyberChef.","messagePattern":"Sorry, the (.+?) operation is not available in the Node\\.js version of CyberChef\\.","errorType":"exception","errorClass":"ExcludedOperationError","httpStatus":null,"severity":"error","filePath":"src/node/api.mjs","lineNumber":352,"sourceCode":"export async function bake(input, recipeConfig) {\n    const recipe = new NodeRecipe(recipeConfig);\n    const dish = ensureIsDish(input);\n    return await recipe.execute(dish);\n}\n\n\n/**\n * explainExcludedFunction\n *\n * Explain that the given operation is not included in the Node.js version.\n * @param {String} name - name of operation\n */\nexport function _explainExcludedFunction(name) {\n    /**\n     * Throw new error type with useful message.\n    */\n    const func = () => {\n        throw new ExcludedOperationError(`Sorry, the ${name} operation is not available in the Node.js version of CyberChef.`);\n    };\n    // Add opName prop so NodeRecipe can handle it, just like wrap does.\n    func.opName = name;\n    return func;\n}\n","sourceCodeStart":334,"sourceCodeEnd":358,"githubUrl":"https://github.com/gchq/CyberChef/blob/4290ea753912378913b1f3f54e0fc5720afeda5d/src/node/api.mjs#L334-L358","documentation":"Thrown by the stub function returned from _explainExcludedFunction in the Node API. Some CyberChef operations are browser-only (DOM/UI dependencies) and are deliberately excluded from the Node build; instead of the real operation, the API registers a stub that throws ExcludedOperationError (a distinct subclass) when invoked. The stub carries opName so NodeRecipe can recognise it.","triggerScenarios":"A recipe built for the browser references an operation that is excluded from the Node build, and that recipe is run via chef.bake in Node. The error fires at execution time (when the stub runs), not at recipe-construction time.","commonSituations":"Sharing a recipe between the web UI and a Node pipeline; an operation that needs a browser rendering engine, Web Workers, or user interaction; upgrading CyberChef and finding an operation newly excluded from Node.","solutions":["Replace the excluded operation with a Node-supported equivalent (check the operation list exported by the Node build).","Run that step of the pipeline in the browser UI instead, or pre/post-process around the Node call.","Pin to a CyberChef version where the operation is still Node-supported, if applicable.","Catch ExcludedOperationError specifically so your pipeline can skip or report the unsupported step."],"exampleFix":"// before\nchef.bake(input, [\"Render Image\", \"From Hex\"]); // 'Render Image' is browser-only\n// after\nchef.bake(input, [\"From Hex\"]); // drop or replace the browser-only op","handlingStrategy":"try-catch","validationCode":"// Best-effort pre-filter: drop ops whose stub throws ExcludedOperationError\nimport { operations } from \"cyberchef/src/node/index.mjs\";\nfunction filterExcluded(recipe) {\n  return recipe.filter(ing => { try { /* probe stub */ const name = typeof ing === \"string\" ? ing : ing?.op; /* keep if registered as a real op */ return true; } catch { return false; } });\n}","typeGuard":"const isExcludedStub = (fn) => typeof fn === \"function\" && /not available in the Node\\.js version/.test(fn.toString());","tryCatchPattern":"import { ExcludedOperationError } from \"cyberchef\";\ntry { chef.bake(input, recipe); } catch (e) { if (e instanceof ExcludedOperationError) { /* log unsupported op: e.message, skip or replace */ } else throw e; }","preventionTips":["Check whether an operation is Node-supported before sharing browser recipes with a Node pipeline.","Catch ExcludedOperationError specifically so pipelines can skip/report unsupported steps.","Keep browser-only operations out of Node-bound recipe JSON."],"tags":["node-api","excluded-operation","browser-only","excludedoperationerror"],"backgroundTag":null,"analyzedSha":"4290ea753912378913b1f3f54e0fc5720afeda5d","analyzedAt":"2026-08-13T06:05:50.210Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}