handlebars-lang/handlebars.js · error · Exception
TrackIds and stringParams are no longer supported. See Githu
Error message
TrackIds and stringParams are no longer supported. See Github #1145
What it means
The legacy compile options trackIds and stringParams were removed; supplying either throws with a pointer to GitHub issue #1145. They previously changed metadata passed to helpers and were replaced by the block-params/data mechanism.
Source
Thrown at lib/handlebars/compiler/compiler.js:488
compiled = compileInput();
}
return compiled.call(this, context, execOptions);
};
}
function validateInput(input, options) {
if (
input == null ||
(typeof input !== 'string' && input.type !== 'Program')
) {
throw new Exception(
'You must pass a string or Handlebars AST to Handlebars.compile. You passed ' +
input
);
}
if (options.trackIds || options.stringParams) {
throw new Exception(
'TrackIds and stringParams are no longer supported. See Github #1145'
);
}
if (!('data' in options)) {
options.data = true;
}
if (options.compat) {
options.useDepths = true;
}
}
function compileEnvironment(input, options, env) {
let ast = env.parse(input, options);
return new env.Compiler().compile(ast, options);
}
function argEquals(a, b) {
if (a === b) {View on GitHub (pinned to 13a7a67991)
Solutions
- Remove trackIds and stringParams from the options object.
- If you need parameter tracking in helpers, use the modern @data/block-params features (options.data).
- When upgrading, prune deprecated options from centralized compile-config helper functions.
Example fix
// before
Handlebars.compile(tpl, {trackIds: true, stringParams: true});
// after
Handlebars.compile(tpl, {}); Defensive patterns
Strategy: validation
Validate before calling
function compileClean(src, options = {}) {
const { trackIds, stringParams, ...rest } = options;
if (trackIds !== undefined || stringParams !== undefined) {
console.warn('trackIds/stringParams are removed (handlebars #1145); ignoring');
}
return Handlebars.compile(src, rest);
} Type guard
const hasRemovedOptions = (o) => o != null && ('trackIds' in o || 'stringParams' in o); Try / catch
try { return Handlebars.compile(src, options); } catch (e) { if (/TrackIds and stringParams/.test(e.message)) { const { trackIds, stringParams, ...rest } = options; return Handlebars.compile(src, rest)(data); } throw e; } Prevention
- Audit shared compile-options objects when upgrading Handlebars.
- Destructure-and-drop deprecated options at the config boundary.
- Replace tracking features with modern options.data / block params.
When it happens
Trigger: Handlebars.compile(tpl, {trackIds: true}) or {stringParams: true} — options carried over from Handlebars 1.x/2.x code.
Common situations: Upgrading old Handlebars versions where shared options objects still contain trackIds/stringParams; copied config from outdated tutorials.
Related errors
AI-assisted analysis of handlebars-lang/handlebars.js@13a7a67991 (2026-09-02).
Data as JSON: /api/errors/83d83f9d75ef125b.
Report an issue: GitHub.