Skip to content

fix: disable twoslash for cloudflare build#8920

Closed
jhcpeixoto wants to merge 1 commit into
nodejs:refactor/split-apps-by-deployment-targetfrom
jhcpeixoto:fix/8917-cloudflare-twoslash-build
Closed

fix: disable twoslash for cloudflare build#8920
jhcpeixoto wants to merge 1 commit into
nodejs:refactor/split-apps-by-deployment-targetfrom
jhcpeixoto:fix/8917-cloudflare-twoslash-build

Conversation

@jhcpeixoto
Copy link
Copy Markdown

@jhcpeixoto jhcpeixoto commented May 30, 2026

Targets #8917.

The Cloudflare OpenNext build fails while collecting page data because the Cloudflare MDX config imports a VFS Twoslash setup, which pulls Node.js filesystem modules into the Worker bundle. This keeps syntax highlighting enabled on Cloudflare but disables Twoslash for that deployment target, and removes the now-unused VFS generator/dependencies.

@jhcpeixoto jhcpeixoto requested a review from a team as a code owner May 30, 2026 00:46
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

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

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview May 30, 2026 12:47am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 30, 2026

PR Summary

Low Risk
Cloudflare-only behavior change; syntax highlighting remains, with Twoslash type hover/errors absent on that deployment only.

Overview
Cloudflare MDX now turns off Twoslash while keeping Shiki highlighting (wasm: false, twoslash: false), avoiding Node filesystem code in the Worker bundle during OpenNext page-data collection.

The VFS Twoslash path is removed for this target: create-vfs-twoslasher.mjs, the twoslash-fsmap generator scripts, and prebuild/predeploy/predev hooks that emitted generated/twoslash-fsmap.json. Dependencies twoslash and @typescript/vfs are dropped from platforms/cloudflare/package.json.

Other deployment targets (e.g. default/Vercel) are unchanged and still use Twoslash.

Reviewed by Cursor Bugbot for commit 15cb87e. Bugbot is set up for automated code reviews on this repo. Configure here.

@MattIPv4
Copy link
Copy Markdown
Member

MattIPv4 commented May 30, 2026

Why? I'm not sure I follow removing functionality instead of fixing it...

And, was this PR generated with AI assistance that you haven't declared? Your PR body originally had escaped newline characters which is usually a tell-tale sign of that.

@jhcpeixoto
Copy link
Copy Markdown
Author

Why?

Is fix of other PR

@MattIPv4
Copy link
Copy Markdown
Member

I don't think removing functionality is particularly a fix?

@avivkeller
Copy link
Copy Markdown
Member

That generation was specifically added because it works on CF deployments. Removing it would not make sense.

@jhcpeixoto jhcpeixoto closed this May 30, 2026
@jhcpeixoto jhcpeixoto deleted the fix/8917-cloudflare-twoslash-build branch May 30, 2026 00:53
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.

3 participants