Fix CI error by upgrading TypeScript and related dependencies to resolve type compatibility issues#299
Closed
Fix CI error by upgrading TypeScript and related dependencies to resolve type compatibility issues#299
Conversation
|
|
Member
|
@copilot the CI error log is: |
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CI error in Casbin.js
Fix CI error by upgrading TypeScript and related dependencies to resolve type compatibility issues
Oct 12, 2025
Contributor
Author
... The log appears to be truncated - it shows the runner initialization but doesn't include the actual error. I've verified locally that all checks pass:
Could you share the complete error log or the specific failure that occurred? The current log only shows the setup phase. |
Copilot stopped work on behalf of
hsluoyz due to an error
October 12, 2025 07:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CI build was failing due to a TypeScript version incompatibility. The project was using TypeScript 4.2.4, which is incompatible with newer versions of
@types/node(v24.7.2) that were being automatically installed by yarn. The@types/nodepackage uses modern TypeScript features that require TypeScript 4.5+ or higher, including:infer ... extendssyntaxoverridekeywordThis resulted in over 1400 compilation errors during the build process, causing the CI to fail.
See: https://github.com/casbin/casbin.js/actions/runs/18440657926/job/52540559253
Solution
Upgraded the TypeScript ecosystem to compatible versions:
Core TypeScript Stack
4.2.4→^5.3.3^26.5.6→^29.1.0^26.1.0→^29.5.0^26.0.23→^29.5.0ESLint Stack
^4.0.0→^5.62.0^3.2.0→^5.62.0^7.7.0→^8.57.0^6.11.0→^8.10.0Additional Dependencies
@types/minimatch@5.1.2(required by@types/glob)jest-environment-jsdom@^30.2.0(required for localStorage support in Jest 29)Configuration Changes
jestconfig.jsonto specify"testEnvironment": "jsdom"for proper DOM/localStorage support in Jest 29+Verification
All CI checks now pass successfully:
anytypes)The changes maintain backward compatibility and don't affect the public API or functionality of the library.
Original prompt
Fixes #298
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.