Fix CI failures in Node.js 21+ and TypeScript type checking #246
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
CI was failing with two errors:
Navigator assignment error in Node.js 21+:
TypeScript type checking error in the deprecated
remark-mdx-imagesdependency:Solution
Navigator Fix
Starting with Node.js 21, the global
navigatorobject became read-only. Changed from direct assignment to usingObject.defineProperty()with appropriate flags:TypeScript Fix
The
remark-mdx-imagespackage (which is deprecated) has type incompatibilities with newer@types/estree. Created a type declaration override that provides a simple module declaration, allowing TypeScript to skip the detailed type checking of this third-party package.Testing
These minimal changes fix CI without requiring removal of kcd-scripts or other breaking changes. The solution works across all supported Node.js versions (18, 20, 22, 23).
Fixes #[issue_number]
Original prompt
Fixes #245
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Note
Use Object.defineProperty for global navigator in tests, add a remark-mdx-images type override, and relax TS config to pass CI.
src/__tests__/setup-tests.jsto setglobal.navigatorviaObject.definePropertyfor Node 21+.src/remark-mdx-images.d.tsto declareremark-mdx-imagesas aunifiedPlugin.tsconfig.jsonto enableskipLibCheckand excludenode_modules.Written by Cursor Bugbot for commit 2d2db6b. This will update automatically on new commits. Configure here.