Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"outDir": "dist",
"lib": ["DOM", "DOM.Iterable", "ES2023"],
"composite": true,
"types": ["node", "vitest/globals"]
"types": ["node", "vitest/globals"],
"baseUrl": ".",
"paths": {
"@google/gemini-cli-core": ["./index.ts"]
}
Comment on lines +7 to +11

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.

high

Adding a paths alias for a package to reference itself can lead to runtime errors. The paths option in tsconfig.json is a compile-time feature that is not understood by the Node.js runtime by default. This means that while the code will compile successfully, it will fail at runtime with a MODULE_NOT_FOUND error when it tries to import from @google/gemini-cli-core from within the package itself.

This creates a fragile setup that is hard to debug. For robust module resolution, it's better to use relative paths for intra-package imports. If path aliases are a requirement, they must be accompanied by a runtime resolution mechanism, such as the Node.js imports field in package.json.

To prevent potential runtime failures, it's recommended to remove this path alias.

    "types": ["node", "vitest/globals"]

},
"include": ["index.ts", "src/**/*.ts", "src/**/*.json"],
"exclude": ["node_modules", "dist"]
Expand Down
Loading