Skip to content

[Bug] SyntaxError: The requested module 'ajv' does not provide an export named 'Ajv' #512

Open
@alexander-zuev

Description

@alexander-zuev

Describe the bug

Running integration tests with @modelcontextprotocol/sdk version 1.11.4 raises a runtime error:

SyntaxError: The requested module 'ajv' does not provide an export named 'Ajv'

Downgrading to 1.11.3 resolves the issue.


To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/alexander-zuev/kollektiv-mcp
  2. pnpm remove @modelcontextprotocol/sdk
  3. pnpm add @modelcontextprotocol/[email protected]
  4. pnpm run test

Expected behavior

Integration tests should pass as they do with version 1.11.3.


Logs

FAIL   integration  tests/integration/index.test.ts [ tests/integration/index.test.ts ]
SyntaxError: The requested module 'ajv' does not provide an export named 'Ajv'
Test Files  1 failed | 15 passed (16)
Tests  109 passed (109)

Environment

  • Cloudflare Worker
  • Vitest test runner
  • Node.js v23.6.0
  • pnpm (latest)

Additional context

  • No direct import of ajv in the project.
  • The SDK is used as a dependency; the error appears to be caused by an internal import or packaging change in 1.11.4.
  • Pinning the SDK to 1.11.3 avoids the error.

Workaround

Pin @modelcontextprotocol/sdk to version 1.11.3 in package.json:

"@modelcontextprotocol/sdk": "1.11.3"

Please investigate if a packaging or ESM/CJS export change was introduced in 1.11.4 that affects ajv imports.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions