Why MDX Blogs Throw EvalError on Cloudflare Workers and How to Fix It
A bilingual product blog built with Next.js 16 and next-mdx-remote returned HTTP 500 errors in production on Cloudflare Workers, though it worked locally and in CI. The failure came from an EvalError because Workers' V8 isolates forbid dynamic code evaluation, which next-mdx-remote needs to compile MDX at runtime. The team realized their posts were plain GitHub-flavored Markdown with no embedded React components, so they replaced the MDX compiler with the pure parser marked, passing output through a sanitizer. The migration also surfaced a sanitizer that silently stripped attributes and a loading boundary that hid 404 responses behind a 200 status. The author's takeaway is to use a parser for content and a compiler only for code, and to test on the runtime you actually ship.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in