Skip to content

Conversation

@bhosmer-ant
Copy link
Contributor

@bhosmer-ant bhosmer-ant commented May 19, 2025

Downgrade Ajv from v8.17.1 to v6.12.6 to resolve ESM/CJS module compatibility issues that were causing "does not provide an export named 'Ajv'" errors in projects using this SDK. This ensures consistent import patterns across different module systems.

🤖 Generated with Claude Code

Motivation and Context

Original PR built successfully, tracking down where the build error was subsequently introduced. Meanwhile this simplifies things by using the same version of ajv as eslint and builds successfully.

How Has This Been Tested?

SDK tests pass

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

May fix #512

Downgrade Ajv from v8.17.1 to v6.12.6 to resolve ESM/CJS module compatibility issues that were causing "does not provide an export named 'Ajv'" errors in projects using this SDK. This ensures consistent import patterns across different module systems.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@bhosmer-ant bhosmer-ant requested review from ihrpr and pcarleton May 19, 2025 17:17
@ihrpr
Copy link
Contributor

ihrpr commented May 20, 2025

Should we just upgrade eslint as well to make sure we have only one version of Ajv?

@bhosmer-ant
Copy link
Contributor Author

Should we just upgrade eslint as well to make sure we have only one version of Ajv?

Sadly it looks like the latest eslint is still using the old version of ajv

@bhosmer-ant bhosmer-ant merged commit 3975c1a into main May 20, 2025
5 checks passed
@bhosmer-ant bhosmer-ant deleted the basil/ajv_downgrade branch May 20, 2025 16:38
Pizzaface pushed a commit to RewstApp/mcp-inspector that referenced this pull request Aug 20, 2025
make auth token configurable via env var
@jake-danton
Copy link

@bhosmer-ant @ihrpr @alexander-zuev
sorry to re-awaken this old thread, but there are multiple conversations (e.g. #689, ones in Cloudflare repos) going on around upgrading to AJV v8 as well as PRs (e.g. #844) for it. So when I realized it had already gotten in and then was reverted, I was surprised.

Since eslint is in "devDependencies", there should be no requirement to choose an actual dependency based on it as no consumer of the library will get a dependency on eslint. And given that eslint runs as a standalone process (i.e. it doesn't run during tests) then there is no issue with two versions of AJV being loaded at one time.

And as for the issue in #512 , I believe that was due to Vitest having issues with AJV v8 and Cloudflare workers as seen in this Cloudflare bug which sounds like it has a workaround. So it is an uncommon case due to a bug in other libraries, not due to having ajv upgraded to v8 while having eslint as a dev dependency.

So is there any reason we can't revert this revert?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants