gchq/CyberChef · warning · OperationError

Length must be less than ${maxLoremWords}

Error message

Length must be less than ${maxLoremWords}

What it means

Thrown by checkLimits() when lengthType is Paragraphs, Sentences, or Words and length exceeds maxLoremWords. This caps generation to prevent excessive output. The limit is a module-level constant (maxLoremWords).

Source

Thrown at src/core/operations/GenerateLoremIpsum.mjs:90

export default GenerateLoremIpsum;

/**
 * check combined validity of lengthType and length arguments
 * @param {string} lengthType
 * @param {number} length
 * @throws {OperationError}
 */
function checkLimits(lengthType, length) {
    if (length < 1) {
        throw new OperationError("Length must be greater than 0");
    }

    switch (lengthType) {
        case "Paragraphs":
        case "Sentences":
        case "Words":
            if (length > maxLoremWords) {
                throw new OperationError("Length must be less than " + maxLoremWords);
            }
            break;
        case "Bytes":
            if (length > maxLoremCharacters) {
                throw new OperationError("Length must be less than " + maxLoremCharacters);
            }
            break;
        default:
            throw new OperationError("Invalid length type");
    }
}

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Reduce length to at most maxLoremWords (check the module constant for its current value).
  2. If more text is genuinely needed, generate in batches and concatenate.
Defensive patterns

Strategy: validation

Validate before calling

if (["Paragraphs", "Sentences", "Words"].includes(lengthType) && length > maxLoremWords) {
  // cap length to maxLoremWords before invoking
}

Prevention

When it happens

Trigger: Requesting more words/sentences/paragraphs than maxLoremWords allows.

Common situations: User requesting a very large document, or a script defaulting to a high length value.

Related errors


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