Skip to content

fix(spanner): type conflict between @sinonjs/fake-timers and @types/sinonjs__fake-timers#7962

Merged
alkatrivedi merged 4 commits intomainfrom
fix-build
Apr 7, 2026
Merged

fix(spanner): type conflict between @sinonjs/fake-timers and @types/sinonjs__fake-timers#7962
alkatrivedi merged 4 commits intomainfrom
fix-build

Conversation

@alkatrivedi
Copy link
Copy Markdown
Contributor

@alkatrivedi alkatrivedi commented Apr 6, 2026

This PR resolves build-time TypeScript errors triggered by upstream dependency updates

Problem
When running npm install or npm run compile, the build fails due to a type conflict between @sinonjs/fake-timers and @types/sinon (which pulls in @types/sinonjs__fake-timers). Both packages try to define symbols like withGlobal in the global scope, leading to a Duplicate identifier 'withGlobal' error

Solution
Uses npm overrides to pin @sinonjs/fake-timers to the last known stable version (15.2.1). This eliminates the duplicate definitions at the source while preserving strict type checking for our own codebase.

Future Work

Revert this change, as soon as the fix for the conflict will be merge in fake-timer repository

@alkatrivedi alkatrivedi requested a review from a team as a code owner April 6, 2026 04:12
@alkatrivedi alkatrivedi force-pushed the fix-build branch 2 times, most recently from d586b65 to bf0e097 Compare April 6, 2026 05:13
@alkatrivedi alkatrivedi added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 6, 2026
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 6, 2026
"overrides": {
"gcp-metadata": "^7.0.1"
"gcp-metadata": "^7.0.1",
"@sinonjs/fake-timers": "15.2.1"
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.

Please verify this change does not change the minimum version of Node or any other major components that are required to use this library ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

since, we are already on Node 18, and not modifying the libraries engine, this fix will not change the minimum version of node or any other major component

@alkatrivedi alkatrivedi changed the title chore: enable skipLibCheck in tsconfig to resolve node modules type c… fix: type conflict between @sinonjs/fake-timers and @types/sinonjs__fake-timers Apr 6, 2026
@alkatrivedi alkatrivedi added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 7, 2026
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 7, 2026
@alkatrivedi alkatrivedi requested a review from surbhigarg92 April 7, 2026 10:26
@alkatrivedi alkatrivedi changed the title fix: type conflict between @sinonjs/fake-timers and @types/sinonjs__fake-timers fix(spanner): type conflict between @sinonjs/fake-timers and @types/sinonjs__fake-timers Apr 7, 2026
"overrides": {
"gcp-metadata": "^7.0.1"
"gcp-metadata": "^7.0.1",
"@sinonjs/fake-timers": "15.2.1"
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.

Do we need to fix the version to "15.2.1" . This would mean no updates will be used for this package

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there is already an open issue and a fix PR in fake-timers repository regarding this conflict.

once they will merge the fix we will revert this change. in the meantime we will fix the build failure with this stable version

@alkatrivedi alkatrivedi merged commit 2280f7a into main Apr 7, 2026
36 checks passed
@alkatrivedi alkatrivedi deleted the fix-build branch April 7, 2026 11:14
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