BoundaryML/baml · error · Error
Update to @boundaryml/baml required. Version from generators
Error message
Update to @boundaryml/baml required.
Version from generators.baml: ${generatedVersion}
Current @boundaryml/baml version: ${runtimeVersion}
Please upgrade @boundaryml/baml to version ${generatedVersion}.
$ npm install @boundaryml/baml@${generatedVersion}
$ yarn add @boundaryml/baml@${generatedVersion}
$ pnpm add @boundaryml/baml@${generatedVersion}
If nothing else works, please ask for help:
https://github.com/boundaryml/baml/issues
https://boundaryml.com/discord What it means
Generated BAML client code embeds the @boundaryml/baml version it was generated with (generators.baml). At import time ThrowIfVersionMismatch compares it with the installed runtime version and throws if the runtime is older, because the generated code may use APIs the runtime lacks.
Source
Thrown at engine/language_client_typescript/safe_imports.js:32
}
function ThrowIfVersionMismatch(generatedVersion) {
const runtimeVersion = (0, native_1.get_version)();
if (!ensureVersionCompatibility(generatedVersion, runtimeVersion)) {
const errorMessage = `Update to @boundaryml/baml required.
Version from generators.baml: ${generatedVersion}
Current @boundaryml/baml version: ${runtimeVersion}
Please upgrade @boundaryml/baml to version ${generatedVersion}.
$ npm install @boundaryml/baml@${generatedVersion}
$ yarn add @boundaryml/baml@${generatedVersion}
$ pnpm add @boundaryml/baml@${generatedVersion}
If nothing else works, please ask for help:
https://github.com/boundaryml/baml/issues
https://boundaryml.com/discord`;
throw new Error(errorMessage.trim());
}
}
View on GitHub (pinned to bd85ce9dee)
Solutions
- Run the printed command: `npm install @boundaryml/baml@<generatedVersion>` (or yarn/pnpm equivalent).
- Re-run `baml generate` after upgrading so versions agree.
- Add a postinstall/CI check that versions match, or pin the CLI and package to the same version.
Example fix
// shell // before (generatedVersion 0.80.0, installed 0.77.0) # npm i // after # npm install @boundaryml/baml@0.80.0 && baml generate
Defensive patterns
Strategy: validation
Validate before calling
// scripts/check-baml-version.mjs
import generated from './generated_code/version.json' with { type: 'json' };
import pkg from './node_modules/@boundaryml/baml/package.json' with { type: 'json' };
if (pkg.version !== generated.version) throw new Error(`baml version mismatch: runtime ${pkg.version} vs generated ${generated.version}`); Try / catch
try {
const b = require('./generated_code');
} catch (e) {
if (String(e.message).includes('Update to @boundaryml/baml required')) {
console.error('Run: npm install @boundaryml/baml@<version from generators.baml>, then baml generate');
}
throw e;
} Prevention
- After every `baml generate`, run npm/yarn/pnpm install so the runtime matches.
- Pin the BAML CLI and @boundaryml/baml to the same version in package.json.
- Add a CI step comparing the generator version with the installed package.
When it happens
Trigger: Importing generated_code (e.g. b.baml or index.ts) after `baml generate` bumped the required version, while package.json still pins an older @boundaryml/baml; OR a runtime newer than the generator version.
Common situations: Upgrading the BAML CLI and re-generating without running npm install; teammates pulling generated files but a stale lockfile; CI caching an old node_modules; mixed versions across a monorepo.
Related errors
- {kind}: toolchain {artifact_fingerprint} / format {artifact_
- Update to @boundaryml/baml required. Version from generators
- failed to exec baml-cli: {err}
- {kind} is not a versioned BAML artifact; {}
- the installed BAML agent skill does not match this toolchain
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/aca6fa61f139639a.
Report an issue: GitHub.