Skip to content

fix(firestore-genai-chatbot): stop importing a non-exported subpath - #2962

Merged
IzaakGough merged 1 commit into
kitsfrom
fix/kits-genai-chatbot-vertex-plugin-options
Aug 20, 2026
Merged

fix(firestore-genai-chatbot): stop importing a non-exported subpath#2962
IzaakGough merged 1 commit into
kitsfrom
fix/kits-genai-chatbot-vertex-plugin-options

Conversation

@IzaakGough

Copy link
Copy Markdown

The node.js_22_test job fails for every PR targeting kits. The repo-wide build runs in postinstall, so one kit failing to compile kills the job regardless of what the PR touches:

kits/firestore-genai-chatbot/src/generative-client/genkit.ts(23,42): error TS2307:
Cannot find module '@genkit-ai/google-genai/lib/vertexai' or its corresponding type declarations.

@genkit-ai/google-genai only declares "." in its exports map. The old node resolution ignored exports, so the deep lib/vertexai import resolved; nodenext honours it, so the subpath no longer resolves. The package does not re-export VertexPluginOptions from its root, so this derives the type from the exported vertexAI plugin instead.

Verified: tsc -b --force on the kit goes from the error above to clean, 21 tests pass, and prettier --check is clean on the changed file.

`@genkit-ai/google-genai` only declares `"."` in its `exports` map, so the
deep import of `lib/vertexai` fails to resolve under `moduleResolution:
nodenext`. Derive `VertexPluginOptions` from the exported `vertexAI` plugin
instead, since the package does not re-export the type from its root.

This unbreaks the repo-wide build in postinstall, which currently fails the
test job on every PR targeting `kits`.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the import of VertexPluginOptions in genkit.ts. Instead of importing the type from a deep internal path of @genkit-ai/google-genai which is not re-exported from the package root, it is now dynamically extracted using TypeScript's utility types from the vertexAI function parameters. There are no review comments, and I have no feedback to provide.

@IzaakGough
IzaakGough marked this pull request as ready for review August 20, 2026 10:14
@IzaakGough
IzaakGough merged commit bf1ce29 into kits Aug 20, 2026
9 checks passed
@IzaakGough
IzaakGough deleted the fix/kits-genai-chatbot-vertex-plugin-options branch August 20, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants