discourse/discourse · error · Error
${this.constructor.name} must implement evaluate()
Error message
${this.constructor.name} must implement evaluate() What it means
Error "${this.constructor.name} must implement evaluate()" thrown in discourse/discourse.
Source
Thrown at frontend/discourse/app/blocks/conditions/condition.ts:266
? this.resolveSource(args, context)
: this.defaultSource;
}
/**
* Evaluates whether the condition passes.
* Called at render time to determine if a block should be shown.
*
* **Note: This method MUST be pure and idempotent.** It may be called
* multiple times during a single render cycle (e.g., when debug logging
* is enabled), and should not have side effects.
*
* @param args - The condition arguments from the layout entry.
* @param context - Evaluation context from the blocks service.
* @returns True if condition passes, false otherwise.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
evaluate(args: Record<string, unknown>, context?: ConditionContext): boolean {
throw new Error(`${this.constructor.name} must implement evaluate()`);
}
/**
* Returns the resolved value for debug logging purposes.
*
* Override this method in subclasses to provide custom resolved values
* for conditions that don't use the standard `source` parameter.
* For example, the `outletArg` condition uses a `path` parameter
* to resolve values from outlet args.
*
* @param args - The condition arguments from the layout entry.
* @param context - Evaluation context containing outletArgs.
* @returns Object with resolved value, or undefined if this condition doesn't resolve values.
*/
getResolvedValueForLogging(
args: Record<string, unknown>,
context?: ConditionContext
): ConditionResolvedValue | undefined {View on GitHub (pinned to 1b2d7253e8)
When it happens
Trigger: Thrown at frontend/discourse/app/blocks/conditions/condition.ts:266 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of discourse/discourse@1b2d7253e8 (2026-08-26).
Data as JSON: /api/errors/10759527e7ca96c6.
Report an issue: GitHub.