fix(ai): drop the getImagenModel wrapper, removed in firebase 12.18 - #3750
fix(ai): drop the getImagenModel wrapper, removed in firebase 12.18#3750armando-navarro wants to merge 1 commit into
Conversation
Firebase shut the Imagen models down in August 2026 and @firebase/ai 2.15.0 (firebase 12.18.0) removed the API. Our ai entry point named-imports getImagenModel, so any install resolving firebase 12.18.0, which ^12.4.0 does on every fresh install, fails to build. The generator now excludes getImagenModel from the wrapped named imports. Installs whose firebase still includes the symbol (12.17 and older) keep compiling, because the entry point re-exports everything from firebase/ai with export *. That is compile-time grace only: the models are shut down, so the calls fail at the service on any firebase version. The package keeps building against firebase 12.4.0, the lowest version the published ^12.4.0 range allows, so every symbol the generated file imports by name exists in every firebase version a user's install can resolve: a sweep of every wrapped @firebase package between the 12.4.0- and 12.18.0-mapped versions found getImagenModel to be the only removed export. The ng update migration now warns on getImagenModel imports with guidance to move image generation to the Gemini image models via getGenerativeModel, with a spec. The upgrade guide documents the removal and its migration section is restructured for readability.
tyler-reitz
left a comment
There was a problem hiding this comment.
Verified independently: the named imports of all 14 generated firebase.ts files typecheck against a real firebase 12.18.0 install, and re-adding getImagenModel reproduces the TS2305 from #3749; regenerating every entry point with this branch's tools/build.ts produces zero drift against the committed files; the new migration spec goes red with the tables.ts entry removed; and the published rc tarball keeps export * from 'firebase/ai' verbatim in the shipped .d.ts and fesm, so the fix carries through to the artifact users install.
One note, not a change request: on firebase 12.17 and older, getImagenModel is still reachable through the star export but now unwrapped, where the zone-wrapped named export used to shadow it (ran both shapes to confirm the precedence). Since every call fails at the shut-down service, the only effect is the rejection settling outside the Angular zone, consistent with the compile-time-grace framing in the description.
Checklist
@angular/fire/aifails to build against firebase 12.18, which removedgetImagenModel#3749docs/ai.mdyarn install,yarn testrun successfully?: yesDescription
Fixes #3749.
Firebase shut the Imagen models down in August 2026 and removed the Imagen API in
@firebase/ai2.15.0, which ships in firebase 12.18.0. Theaientry point importsgetImagenModel, so any app whose install resolves firebase 12.18.0 fails to build.The fix
getImagenModelfrom the wrapped named imports (a null override intools/build.ts).firebase/aiwithexport *. That is compile-time grace only: the models are shut down, so the calls fail at the service on any firebase version.^12.4.0range allows. That way every symbol the generated file imports by name exists in every firebase version a user's install can resolve.Verification
@firebasepackage between the 12.4.0-mapped and 12.18.0-mapped versions confirmedgetImagenModelis the only export removed in that window.Also in this change
ng updateVertex AI migration treatsgetImagenModelas a removed symbol, leaving the import in place and logging guidance to move image generation to the Gemini image models throughgetGenerativeModel, with a new spec covering it.docs/ai.mdno longer advertises Imagen models.