gchq/CyberChef · error · TypeError

Couldn't find an operation with name '${ing}'.

Error message

Couldn't find an operation with name '${ing}'.

What it means

Thrown by NodeRecipe._validateIngredient when the ingredient is a string that does not match any registered operation after case/whitespace sanitisation. This is a TypeError (not OperationError) because it indicates a malformed Node API recipe, not bad user data flowing through an operation.

Source

Thrown at src/node/NodeRecipe.mjs:43

    /**
     * Validate an ingredient & coerce to operation if necessary.
     * @param {String | Function | Object} ing
     * @returns {Function || Object} The operation, or an object with the
     *  operation and its arguments
     * @throws {TypeError} If it cannot find the operation in chef's list of operations.
     */
    _validateIngredient(ing) {
        // CASE operation name given. Find operation and validate
        if (typeof ing === "string") {
            const op = operations.find((op) => {
                return sanitise(op.opName) === sanitise(ing);
            });
            if (op) {
                // Need to validate against case 2
                return this._validateIngredient(op);
            } else {
                throw new TypeError(`Couldn't find an operation with name '${ing}'.`);
            }
        // CASE operation given. Check its a chef operation and check its not flowcontrol
        } else if (typeof ing === "function") {
            if (ing.flowControl) {
                throw new TypeError(`flowControl operations like ${ing.opName} are not currently allowed in recipes for chef.bake in the Node API`);
            }

            if (operations.includes(ing)) {
                return ing;
            } else {
                throw new TypeError("Inputted function not a Chef operation.");
            }
        // CASE: op, maybe with configuration
        } else if (ing.op) {
            const sanitisedOp = this._validateIngredient(ing.op);
            if (ing.args) {
                return {op: sanitisedOp, args: ing.args};
            }

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Check the exact operation name against the installed build's operation list (e.g. the UI or the exported operations).
  2. Correct typos and spacing; note that sanitise tolerates case but the canonical name is safest.
  3. Upgrade/downgrade CyberChef so the operation exists, or substitute an equivalent operation.
  4. If the operation is excluded from Node, replace it with a Node-supported alternative.

Example fix

// before
chef.bake(input, [{op:"From Base 64", args:[...]}]); // wrong name
// after
chef.bake(input, [{op:"From Base64", args:[...]}]);
Defensive patterns

Strategy: validation

Validate before calling

import { operations } from "cyberchef/src/node/index.mjs";
import { sanitise } from "cyberchef/src/node/apiUtils.mjs";
function recipeHasKnownOps(recipe) {
  for (const ing of recipe) {
    const name = typeof ing === "string" ? ing : ing?.op;
    if (typeof name === "string" && !operations.some(o => sanitise(o.opName) === sanitise(name)))
      throw new Error(`Unknown operation: ${name}`);
  }
}

Type guard

const isKnownOp = (name) => operations.some(o => sanitise(o.opName) === sanitise(name));

Try / catch

try { chef.bake(input, recipe); } catch (e) { if (e instanceof TypeError && /Couldn't find an operation/.test(e.message)) { /* correct/replace op name */ } else throw e; }

Prevention

When it happens

Trigger: A recipe array passed to chef.bake (or new NodeRecipe) contains a string op name that no registered operation has. The match uses sanitise() on both sides, so casing/spacing are tolerant, but a genuinely unknown/misspelled/moved op still fails.

Common situations: Typo in the op name; using an operation that was renamed or removed in the installed CyberChef version; referencing an operation that is browser-only and excluded from the Node build (see error 718); version skew between the recipe author and the runtime.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/752d5a79ab17a5f6. Report an issue: GitHub.