Fix ERR_MODULE_NOT_FOUND by codegen sdkProtocolVersion.ts#10
Merged
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>
Copilot
AI
changed the title
[WIP] Fix missing module error in SDK versions 0.1.10 and 0.1.11
Fix ERR_MODULE_NOT_FOUND by codegen sdkProtocolVersion.ts
Jan 15, 2026
Contributor
There was a problem hiding this comment.
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.
friggeri
approved these changes
Jan 15, 2026
patniko
approved these changes
Jan 15, 2026
jmoseley
pushed a commit
that referenced
this pull request
Jan 21, 2026
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.
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.