-
Notifications
You must be signed in to change notification settings - Fork 659
Fix ERR_MODULE_NOT_FOUND by codegen sdkProtocolVersion.ts #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request fixes a critical module resolution error in SDK versions 0.1.10 and 0.1.11 where the TypeScript SDK was attempting to import sdk-protocol-version.json, but the JSON file was not included in the npm package distribution. The fix generates a TypeScript file with hardcoded protocol version constants instead of importing from JSON, consistent with how Go, Python, and .NET SDKs already handle protocol versioning.
Changes:
- Updated
update-protocol-version.tsscript to generate TypeScript code with hardcoded version constant - Modified
nodejs/src/sdkProtocolVersion.tsto export a constant instead of importing JSON - Fixed npm script name from
generate-protocol-versiontoupdate-protocol-version - Updated comments across all language implementations to reference the correct script name
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| nodejs/src/sdkProtocolVersion.ts | Replaced JSON import with hardcoded SDK_PROTOCOL_VERSION constant |
| nodejs/scripts/update-protocol-version.ts | Added TypeScript code generation to create version constants |
| nodejs/package.json | Fixed script name to match actual filename |
| python/copilot/sdk_protocol_version.py | Updated generated code comment to reference correct script |
| go/sdk_protocol_version.go | Updated generated code comment to reference correct script |
| dotnet/src/SdkProtocolVersion.cs | Updated generated code comment to reference correct script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Versions 0.1.10+ fail at runtime with
ERR_MODULE_NOT_FOUNDbecause the builtdist/sdkProtocolVersion.jsimports../../sdk-protocol-version.json, which is excluded from the published package.Changes
scripts/update-protocol-version.tsto generate TypeScript code (already generates Go/Python/C#)src/sdkProtocolVersion.tswith protocol version as a hardcoded constantgenerate-protocol-version.ts→update-protocol-version.tsBefore
After
Built output now contains no external imports, consistent with other SDK languages.
Original prompt
💡 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.