VertexAIBackend changed in firebase 13.1.0
In our sandbox runs up to 2026-10-27, claude-sonnet-5-5 and gpt-6.1-sol wrote const { getAI, VertexAIBackend } = require("firebase/ai"); for firebase. It fails on 13.1.0 with TypeError (changed between 12.11.0 and 13.1.0). Use const { getAI, AgentPlatformBackend } = require("firebase/ai"); instead.
- What to do
- replace the line
- Output
- same on one example
- Patch
- incomplete: old names remain
- Auto-apply
- not allowed
- Seen in
- 2 models
- Worked / failed
- 9 / 0
- Last verified
- 2026-10-27
What to do
Not for automatic application — after the patch the example still uses VertexAIBackend, which the verified example does not: the patch covers part of the change. Show this correction to the user as a lead. Replace the old line with the new one; the rest of the code can stay.
Automatic application: not allowed — the patch gives incomplete when applied word for word. Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own. The change itself is described by kind (changed); the checks are in proof; neither follows from the other.
How to tell this applies to your code
- firebase version 13.1.0 or newer is installed (checked on 13.1.0; changed between 12.11.0 and 13.1.0).
- Your code uses:
VertexAIBackend - Or it already failed with:
TypeError: VertexAIBackend is not a constructor(every correction for this error)
Old and new code
const { getAI, VertexAIBackend } = require("firebase/ai");const { getAI, AgentPlatformBackend } = require("firebase/ai");
Error on 13.1.0:
TypeError: VertexAIBackend is not a constructor
Other verified fixes
The fix above passed 6 times. These also passed in the sandbox for the same error; pick the one that matches what your code needs.
No direct replacement · passed 2 times · gpt-6.1-sol · patch: nothing to apply word for word
VertexAIBackend,No direct replacement: drop this use.
Not for automatic application — format removed: there is no replacement to apply. Show this correction to the user as a lead. VertexAIBackend is not available in firebase 13.1.0; remove or replace this use. The same code works on firebase 12.11.0: pin a version before 13.1.0 if you cannot change the code. Release notes: getAI(app, { backend: new AgentPlatformBackend('us-central1') });
Replace the line · passed 1 time · gpt-6.1-sol · patch: incomplete: old names remain
const { getAI, getImagenModel, VertexAIBackend } = require('firebase/ai');const { getAI, getGenerativeModel, AgentPlatformBackend } = require('firebase/ai');Not for automatic application — after the patch the example still uses VertexAIBackend, getImagenModel, which the verified example does not: the patch covers part of the change. Show this correction to the user as a lead. Review before applying: this fix runs on firebase 13.1.0, but its printed output differs from what the original printed on 12.11.0 (observed stdout of one example) — it may do different work. Replace the old line with the new one; the rest of the code can stay.
Alternatives are leads for the user, not for automatic application: Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.
| Script | firebase version | Result |
|---|---|---|
| Code the models wrote | 12.11.0 | works |
| Code the models wrote | 13.1.0 | fails: TypeError |
| Verified example below | 13.1.0 | works |
| Output of the verified example | 13.1.0 | same as the original's on 12.11.0 (observed stdout of one example; not a proof of equivalent behaviour) |
| Patch applied word for word to the example | 13.1.0 | applied word for word, the patch leaves old names in use: it covers part of the change — after the patch the example still uses VertexAIBackend, which the verified example does not: the patch covers part of the change |
Verified example for firebase 13.1.0
const { initializeApp, deleteApp } = require("firebase/app");
const { getAI, AgentPlatformBackend } = require("firebase/ai");
async function main() {
// Placeholder configuration values (no network access is needed)
const firebaseConfig = {
apiKey: "placeholder-api-key",
authDomain: "placeholder-project.firebaseapp.com",
projectId: "placeholder-project",
storageBucket: "placeholder-project.appspot.com",
messagingSenderId: "000000000000",
appId: "1:000000000000:web:0000000000000000000000",
};
const app = initializeApp(firebaseConfig);
// Get a Firebase AI instance using the Vertex AI backend in europe-west4
const ai = getAI(app, { backend: new AgentPlatformBackend("europe-west4") });
// Print the location the AI instance reports
console.log(ai.backend.location);
await deleteApp(app);
}
main()
.then(() => process.exit(0))
.catch((err) => {
console.error(err);
process.exit(1);
});Source
No release-note sentence matched this change; the evidence is the sandbox check above.
Seen in: claude-sonnet-5-5, gpt-6.1-sol · First seen 2026-10-27 · Last verified 2026-10-27 · All corrections for firebase
For agents
- This page as JSON:
https://formachines.ai/errata/npm/firebase/0001-vertexaibackend/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when its
proof.auto_applyis true (Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.)