Skip to content

Module Resolution Error in ESM: Unable to Resolve @modelcontextprotocol/sdk/types.js #459

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

Open
kill136 opened this issue May 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kill136
Copy link

kill136 commented May 7, 2025

Description:
When importing from @modelcontextprotocol/sdk/types.js, a module resolution error occurs indicating that the import path cannot be resolved.

Error Message:

TypeError: Failed to resolve module specifier "@modelcontextprotocol/sdk/types.js". 
Relative references must start with either "/", "./", or "../".

Stack Trace:

Uncaught TypeError TypeError: Failed to resolve module specifier "@modelcontextprotocol/sdk/types.js". Relative references must start with either "/", "./", or "../".
    at (program) (e:\CodingAgent\void\src\vs\code\electron-sandbox\workbench\workbench.ts:308:1)

Environment:

  • VS Code Version: 1.99.0
  • @modelcontextprotocol/sdk Version: 1.7.0
  • Node.js type: "module" (ESM)

Issue Description:
The error occurs when trying to import the types.js module from @modelcontextprotocol/sdk package. This appears to be an ESM module resolution issue where the import path needs to use relative path syntax.

Steps to Reproduce:

  1. Set "type": "module" in package.json
  2. Install @modelcontextprotocol/sdk@1.7.0
  3. Try to import from "@modelcontextprotocol/sdk/types.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant