emberjs/ember.js · error · Error

Attempted to call `precompileTemplate` at runtime, but this

Error message

Attempted to call `precompileTemplate` at runtime, but this API is meant to be used at compile time. You should use `compileTemplate` instead.

What it means

Error "Attempted to call `precompileTemplate` at runtime, but this API is meant to be used at compile time. You should use `compileTemplate` instead." thrown in emberjs/ember.js.

Source

Thrown at packages/@ember/template-compilation/index.ts:36

    }
  ): TemplateFactory;
}

export let __emberTemplateCompiler: undefined | typeof ETC;
export const compileTemplate: typeof ETC.compile = (...args: Parameters<typeof ETC.compile>) => {
  if (!__emberTemplateCompiler) {
    throw new Error(
      'Attempted to call `compileTemplate` without first loading the runtime template compiler.'
    );
  }
  return __emberTemplateCompiler.compile(...args);
};

export let precompileTemplate: PrecompileTemplate;

if (DEBUG) {
  precompileTemplate = () => {
    throw new Error(
      'Attempted to call `precompileTemplate` at runtime, but this API is meant to be used at compile time. You should use `compileTemplate` instead.'
    );
  };
}

export function __registerTemplateCompiler(c: typeof ETC) {
  __emberTemplateCompiler = c;
}

View on GitHub (pinned to 26f97246a8)

When it happens

Trigger: Thrown at packages/@ember/template-compilation/index.ts:36 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01). Data as JSON: /api/errors/9e2d2475b3513433. Report an issue: GitHub.