{"record":{"id":"9e2d2475b3513433","repo":"emberjs/ember.js","slug":"attempted-to-call-precompiletemplate-at-runtime","errorCode":null,"errorMessage":"Attempted to call `precompileTemplate` at runtime, but this API is meant to be used at compile time. You should use `compileTemplate` instead.","messagePattern":"Attempted to call `precompileTemplate` at runtime, but this API is meant to be used at compile time\\. You should use `compileTemplate` instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@ember/template-compilation/index.ts","lineNumber":36,"sourceCode":"    }\n  ): TemplateFactory;\n}\n\nexport let __emberTemplateCompiler: undefined | typeof ETC;\nexport const compileTemplate: typeof ETC.compile = (...args: Parameters<typeof ETC.compile>) => {\n  if (!__emberTemplateCompiler) {\n    throw new Error(\n      'Attempted to call `compileTemplate` without first loading the runtime template compiler.'\n    );\n  }\n  return __emberTemplateCompiler.compile(...args);\n};\n\nexport let precompileTemplate: PrecompileTemplate;\n\nif (DEBUG) {\n  precompileTemplate = () => {\n    throw new Error(\n      'Attempted to call `precompileTemplate` at runtime, but this API is meant to be used at compile time. You should use `compileTemplate` instead.'\n    );\n  };\n}\n\nexport function __registerTemplateCompiler(c: typeof ETC) {\n  __emberTemplateCompiler = c;\n}\n","sourceCodeStart":18,"sourceCodeEnd":45,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@ember/template-compilation/index.ts#L18-L45","documentation":"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.","triggerScenarios":"Thrown at packages/@ember/template-compilation/index.ts:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}