gchq/CyberChef · error · ExcludedOperationError

Sorry, the ${name} operation is not available in the Node.js

Error message

Sorry, the ${name} operation is not available in the Node.js version of CyberChef.

What it means

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.

Source

Thrown at src/node/api.mjs:352

export async function bake(input, recipeConfig) {
    const recipe = new NodeRecipe(recipeConfig);
    const dish = ensureIsDish(input);
    return await recipe.execute(dish);
}


/**
 * explainExcludedFunction
 *
 * Explain that the given operation is not included in the Node.js version.
 * @param {String} name - name of operation
 */
export function _explainExcludedFunction(name) {
    /**
     * Throw new error type with useful message.
    */
    const func = () => {
        throw new ExcludedOperationError(`Sorry, the ${name} operation is not available in the Node.js version of CyberChef.`);
    };
    // Add opName prop so NodeRecipe can handle it, just like wrap does.
    func.opName = name;
    return func;
}

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Replace the excluded operation with a Node-supported equivalent (check the operation list exported by the Node build).
  2. Run that step of the pipeline in the browser UI instead, or pre/post-process around the Node call.
  3. Pin to a CyberChef version where the operation is still Node-supported, if applicable.
  4. Catch ExcludedOperationError specifically so your pipeline can skip or report the unsupported step.

Example fix

// before
chef.bake(input, ["Render Image", "From Hex"]); // 'Render Image' is browser-only
// after
chef.bake(input, ["From Hex"]); // drop or replace the browser-only op
Defensive patterns

Strategy: try-catch

Validate before calling

// Best-effort pre-filter: drop ops whose stub throws ExcludedOperationError
import { operations } from "cyberchef/src/node/index.mjs";
function filterExcluded(recipe) {
  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; } });
}

Type guard

const isExcludedStub = (fn) => typeof fn === "function" && /not available in the Node\.js version/.test(fn.toString());

Try / catch

import { ExcludedOperationError } from "cyberchef";
try { chef.bake(input, recipe); } catch (e) { if (e instanceof ExcludedOperationError) { /* log unsupported op: e.message, skip or replace */ } else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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