Skip to content

fix(cms): strip use-strict prologue from plugin-mcp transpilation#45

Merged
jhb-dev merged 2 commits into
mainfrom
fix/plugin-mcp-ts6-use-strict
Jul 1, 2026
Merged

fix(cms): strip use-strict prologue from plugin-mcp transpilation#45
jhb-dev merged 2 commits into
mainfrom
fix/plugin-mcp-ts6-use-strict

Conversation

@jhb-dev

@jhb-dev jhb-dev commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

… prologue bug

TypeScript 6 prepends a "use strict"; directive to transpileModule output,
causing new Function() to return the string literal instead of the Zod schema.
Subsequent .partial() calls throw TypeError, crashing MCP tool registration
for every collection with create/update enabled -- resulting in 504 timeouts on
all POST /api/mcp requests.

Applies the fix from payloadcms/payload#17109 as a pnpm patch: strip the
"use strict"; prologue from transpileResult.outputText before passing it to
the Function wrapper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website-cms Ready Ready Preview, Comment Jul 1, 2026 12:07am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
website Ignored Ignored Jul 1, 2026 12:07am

Request Review

@jhb-dev jhb-dev changed the title fix(deps): patch plugin-mcp for TypeScript 6 "use strict" prologue bug fix(deps): strip "use strict" prologue in plugin-mcp patch Jun 30, 2026
@jhb-dev jhb-dev changed the title fix(deps): strip "use strict" prologue in plugin-mcp patch fix(cms): strip "use strict" prologue in plugin-mcp patch Jul 1, 2026
@jhb-dev
jhb-dev merged commit ab0ec0e into main Jul 1, 2026
15 of 16 checks passed
@jhb-dev jhb-dev changed the title fix(cms): strip "use strict" prologue in plugin-mcp patch fix(cms): strip use-strict prologue from plugin-mcp transpilation Jul 1, 2026
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.

1 participant