Skip to content

v5.0.4 — Fix V8 Isolate global is not defined

Choose a tag to compare

@renatomarinho renatomarinho released this 01 Aug 07:12
· 4 commits to main since this release

Fixed — V8 Isolate \global is not defined\

@mcpfusion/core\ — \deploy.ts\ bundle sanitizer

  • **\sanitizeBundleForEdge()**: Now replaces bare \global\ with \globalThis\ in the edge bundle. Node.js packages (e.g. @hono/node-server) use \ ypeof global.crypto\ which throws \global is not defined\ in a V8 isolate (browser platform). The sanitizer already transformed \globalThis[\ but missed bare \global\ references from CJS/Node.js dependencies.
  • Regex: /\bglobal\b(?!This|Middleware|Mw)/g\ → \globalThis\ — carefully excludes \globalThis, \globalMiddleware, and \globalMw\ to avoid false positives.
  • Impact: Fixes [StreamableHTTP] createServer failed: global is not defined\ on deploy for any MCP that transitively depends on @hono/node-server\ (via @modelcontextprotocol/node).

Test fix

  • Updated stale regression test that expected SDK v2 packages in \peerDependencies\ (moved to \dependencies\ in 5.0.0).

Full Changelog: v5.0.3...v5.0.4