Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/site/mdx/plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const singletonShiki = await rehypeShikiji({
// for security reasons.
wasm: !OPEN_NEXT_CLOUDFLARE,

// TODO(@avivkeller): Find a way to enable Twoslash w/ a VFS on Cloudflare
twoslash: !OPEN_NEXT_CLOUDFLARE,
twoslash: true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twoslash enabled on Cloudflare despite known incompatibility

High Severity

The twoslash option is now hardcoded to true, removing the !OPEN_NEXT_CLOUDFLARE guard that previously disabled it on Cloudflare Workers. The removed TODO comment explicitly noted that Twoslash with a VFS doesn't work on Cloudflare. Since the wasm option on the line above still uses the !OPEN_NEXT_CLOUDFLARE conditional for an analogous Cloudflare limitation, this change breaks consistency and will likely cause failures when running on Cloudflare Workers.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f23ba96. Configure here.

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

twoslash is now enabled unconditionally. This file previously disabled Twoslash on Cloudflare specifically because it needs a VFS / Node-like filesystem support there, and nothing else in this PR adds that missing support. As-is, Cloudflare worker builds/runtime MDX compilation are likely to fail (or significantly increase CPU/memory) when Twoslash runs. Please gate Twoslash behind !OPEN_NEXT_CLOUDFLARE again or add a Cloudflare-compatible VFS/feature flag that keeps Cloudflare deployments off by default.

Suggested change
twoslash: true,
// Twoslash needs Node-like filesystem/VFS support and is disabled on
// Cloudflare workers until a compatible implementation is available.
twoslash: !OPEN_NEXT_CLOUDFLARE,

Copilot uses AI. Check for mistakes.
});

/**
Expand Down
Loading