{"record":{"id":"6132bd391505c0be","repo":"BoundaryML/baml","slug":"update-to-boundaryml-baml-required-version-from-generators-6132bd","errorCode":null,"errorMessage":"Update to @boundaryml/baml required.\nVersion from generators.baml: ${generatedVersion}\nCurrent @boundaryml/baml version: ${runtimeVersion}\n\nPlease upgrade @boundaryml/baml to version ${generatedVersion}.\n\n$ npm install @boundaryml/baml@${generatedVersion}\n$ yarn add @boundaryml/baml@${generatedVersion}\n$ pnpm add @boundaryml/baml@${generatedVersion}\n\nIf nothing else works, please ask for help:\n\nhttps://github.com/boundaryml/baml/issues\nhttps://boundaryml.com/discord","messagePattern":"Update to @boundaryml/baml required\\.\nVersion from generators\\.baml: (.+?)\nCurrent @boundaryml/baml version: (.+?)\n\nPlease upgrade @boundaryml/baml to version (.+?)\\.\n\n\\$ npm install @boundaryml/baml@(.+?)\n\\$ yarn add @boundaryml/baml@(.+?)\n\\$ pnpm add @boundaryml/baml@(.+?)\n\nIf nothing else works, please ask for help:\n\nhttps://github\\.com/boundaryml/baml/issues\nhttps://boundaryml\\.com/discord","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"engine/language_client_typescript/typescript_src/safe_imports.ts","lineNumber":32,"sourceCode":"export function ThrowIfVersionMismatch(generatedVersion: string) {\n  const runtimeVersion = get_version();\n  if (!ensureVersionCompatibility(generatedVersion, runtimeVersion)) {\n    const errorMessage = `Update to @boundaryml/baml required.\nVersion from generators.baml: ${generatedVersion}\nCurrent @boundaryml/baml version: ${runtimeVersion}\n\nPlease upgrade @boundaryml/baml to version ${generatedVersion}.\n\n$ npm install @boundaryml/baml@${generatedVersion}\n$ yarn add @boundaryml/baml@${generatedVersion}\n$ pnpm add @boundaryml/baml@${generatedVersion}\n\nIf nothing else works, please ask for help:\n\nhttps://github.com/boundaryml/baml/issues\nhttps://boundaryml.com/discord`;\n    \n    throw new Error(errorMessage.trim());\n  }\n}\n","sourceCodeStart":14,"sourceCodeEnd":35,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_typescript/typescript_src/safe_imports.ts#L14-L35","documentation":"BAML generated client code was produced by a newer baml CLI than the installed @boundaryml/baml runtime supports. ThrowIfVersionMismatch compares the version recorded from generators.baml against the runtime version and throws when they differ, since the generated code may use FFI surfaces the runtime lacks. The error includes the exact install commands to fix it.","triggerScenarios":"Importing or initializing the generated BAML client when the version embedded in generators.baml differs from the installed @boundaryml/baml package version; regenerating with an updated CLI (`baml generate`) without upgrading the runtime package, or vice versa.","commonSituations":"A teammate updated baml CLI and committed regenerated code; CI cache installs an older package; pnpm/yarn lockfile not updated after a generator upgrade; monorepo where one workspace pins an old @boundaryml/baml.","solutions":["Run your package manager's install command with the required version, e.g. `npm install @boundaryml/baml@<generatedVersion>` (or yarn/pnpm add).","Commit the updated lockfile so CI and teammates get the matching version.","If you cannot upgrade, downgrade the baml CLI and regenerate so generators.baml matches the installed runtime.","If versions appear to match but the error persists, clear node_modules and reinstall, then report at the linked GitHub issues page."],"exampleFix":"// package.json before\n\"dependencies\": { \"@boundaryml/baml\": \"^0.60.0\" }\n// after\n\"dependencies\": { \"@boundaryml/baml\": \"^0.75.0\" }\n// then: npm install && baml generate","handlingStrategy":"validation","validationCode":"import { version as runtimeVersion } from '@boundaryml/baml/package.json'\n// read generatedVersion from generators.baml and compare before initializing the client\nif (runtimeVersion !== generatedVersion) {\n  throw new Error(`Install @boundaryml/baml@${generatedVersion} (currently ${runtimeVersion})`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin @boundaryml/baml to the exact version emitted by your baml CLI.","Regenerate and reinstall together in one CI step (baml generate && npm install).","Commit the lockfile whenever the generator version changes."],"tags":["version-mismatch","typescript","codegen","dependency"],"backgroundTag":"missing-dependency","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}