JavaScript API

CompileError

The error rejected by every JavaScript entry point.

Every entry point rejects with a CompileError.

import { ErrorSource, CompileError } from "telarel";

CompileError

class CompileError extends Error {
    constructor(message: string, options?: { source?: ErrorSource });

    static from(error: unknown): CompileError;

    name: "CompileError";
    message: string;
    get source(): ErrorSource | undefined;

    render(): string;
}
MemberDescription
fromCoerces any thrown value into a CompileError.
nameAlways "CompileError".
messageThe bare message.
sourceThe attached ErrorSource, if any.
renderRenders the message with a code frame when a source is attached.

The file, code, and span of the error live on source. render returns the bare message when no source is attached.

Only malformed plugin values fail before the pipeline runs. Those validation errors remain TypeErrors rather than becoming CompileErrors.

Last updated on

Copyright © 2026, Alpheus

On this page