You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ERR_PACKAGE_PATH_NOT_EXPORTED with @modelcontextprotocol/express #1858
I am getting a ERR_PACKAGE_PATH_NOT_EXPORTED with message No "exports" main defined in C:\Users\myusersmyproject\node_modules\@modelcontextprotocol\express\package.json when running the @modelcontextprotocol/express example as per the usage guide here
deno run --reload --node-modules-dir=none repro.ts
This fails with:
error: Could not find package '@cfworker/json-schema'
from referrer .../@modelcontextprotocol/server/2.0.0-alpha.2/dist/src-IKPjmxu7.mjs
(@modelcontextprotocol/server@2.0.0-alpha.2).
I checked the published tarball, and dist/src-IKPjmxu7.mjs contains a top-level static import:
import{Validator}from"@cfworker/json-schema";
But @cfworker/json-schema is published as an optional peer dependency, not a regular dependency, so Deno does not include it in the resolved npm dependency graph.
From current main, this looks like it may already be fixed because the CF worker validator no longer appears to be pulled into the main server bundle. If that is correct, could you please publish a new alpha with the current packaging fixes? 2.0.0-alpha.2 is currently not usable from Deno/JSR even for a plain server import.
Closed as already fixed in PR #2405, published in 2.0.0: every v2 package now ships dual ESM and CommonJS builds with a require condition in its export map. See the express package.json and tsdown config. Verified against the published @modelcontextprotocol/express@2.0.0: require('@modelcontextprotocol/express') resolves createMcpExpressApp.
Activity
fix(express): add CJS exports to resolve ERR_PACKAGE_PATH_NOT_EXPORTED
maximemoreillon commentedon Apr 17, 2026
I have set
"type": "module"inpackage.jsonand"module": "NodeNext", "moduleResolution": "NodeNext" but now I am getting:yasaichi commentedon May 8, 2026
I’m seeing what looks like another published artifact issue in the
2.0.0-alpha.2packages, this time with Deno/JSR resolution.Minimal repro:
This fails with:
I checked the published tarball, and
dist/src-IKPjmxu7.mjscontains a top-level static import:But
@cfworker/json-schemais published as an optional peer dependency, not a regular dependency, so Deno does not include it in the resolved npm dependency graph.From current
main, this looks like it may already be fixed because the CF worker validator no longer appears to be pulled into the main server bundle. If that is correct, could you please publish a new alpha with the current packaging fixes?2.0.0-alpha.2is currently not usable from Deno/JSR even for a plain server import.mattzcarey commentedon Sep 11, 2026
Closed as already fixed in PR #2405, published in 2.0.0: every v2 package now ships dual ESM and CommonJS builds with a
requirecondition in its export map. See the express package.json and tsdown config. Verified against the published@modelcontextprotocol/express@2.0.0:require('@modelcontextprotocol/express')resolvescreateMcpExpressApp.