Observed Signal · May 22, 2026 · Technical How-To · Source: DEV Community · Impact: 1/5 · Sentiment: Neutral

Make Dynamic MDX Blogs Work on Cloudflare Workers

Executive Signal Summary

A developer describes a debugging and deployment pattern for Next.js MDX blogs built with OpenNext and deployed to Cloudflare Workers. The issue arose because runtime reads using node:fs work locally but fail or return empty pages when the app is bundled into a Worker. The recommended fix is to move MDX discovery to build time: parse MDX files before build, generate a metadata TypeScript file and a static import registry that imports each MDX post, and ship those generated modules in the Worker bundle. The post includes example scripts, generated-files examples, test commands (pnpm build:cf and opennextjs-cloudflare preview), and a checklist to avoid runtime filesystem reads and variable MDX imports in production.

Polaris7 AgentPolaris7 Strategic Assessment
High Confidence

Practical developer how-to relevant to publisher/web developers and static-site deployments; useful for content publishers but not industry‑shifting for AdTech/MarTech.

SIGNAL RADAR

Track Cloudflare Signals & Market Shifts in Real-Time

Polaris7 autonomous intelligence agents track regulatory filings, primary sources, executive changes, and deal flow 24/7. Create your free Explorer workspace to monitor these entities.

Start Free in Explorer
Free Explorer tierNo credit card requiredInstant watchlist setup

Key Takeaways & Evidence Grounding

  • The author deployed a Next.js MDX blog to Cloudflare Workers using OpenNext and observed empty blog pages in production despite successful local builds.
  • Root cause: the blog code used node:fs to read MDX files at request time; Worker bundles do not expose the project source folder the same way as a local Node.js runtime.
  • Fix: run a prebuild script that parses .mdx files and generates TypeScript files for post metadata and static MDX imports, so the Worker imports compiled MDX modules instead of reading files at runtime.
  • The author wires the generator into npm scripts (prebuild/build and prebuild:cf/build:cf), recommends testing the Cloudflare Worker build (pnpm build:cf) and previewing locally using opennextjs-cloudflare preview.
Primary Source Grounding & Direct Attribution
Direct Origin Attribution
Primary Reporting: DEV Community•Published: May 22, 2026
Original Coverage Title: “Making Dynamic MDX Blogs Work with OpenNext on Cloudflare Workers”

Related Market Signals & Shifts

Recent verified developments and strategic activity across this market segment.

Serverless CMS / Edge PublishingAug 3, 2026

Serverless Blog on Cloudflare Workers with KV and R2

A developer describes building 1001020, a serverless blog and AI gallery that runs entirely on Cloudflare edge infrastructure. The public site is implemented with Cloudflare Workers for routing and rendering, Cloudflare KV for article and site metadata, and Cloudflare R2 for managed image storage and a browsable gallery. The post explains the architecture, storage tradeoffs (KV as a simple key-value content store), image management via R2, and built-in SEO features such as sitemap and robots.txt. The author frames the system as a compact CMS-like publishing stack that avoids a conventional backend while supporting admin operations, sitemaps, and image cleanup workflows.

Read assessment
LLM Integration / CMSJun 5, 2026

Claude posts to my dev blog — bcrypt env gotchas

A developer built a local API endpoint that lets Claude (an LLM) publish draft or updated posts to a personal Next.js dev blog using an X-API-Key. The article documents the stack (Next.js 16, React 19, TypeScript, Tailwind v4, Zod, bcryptjs) and an important gotcha: Next.js's @next/env loader performs variable expansion inside quoted .env values, which breaks bcrypt hashes that contain $ characters. The author describes two working fixes — escape dollar signs in the env value, or store a raw API key for local dev and use a timing-safe comparison — and shows a verifier that prefers a stored hash but falls back to a raw key. The post also covers endpoint design (GET/POST/PUT/DELETE), a file-based JSON store, usage flows with Claude, and planned future improvements (Postgres migration, Dev.to cross-posting, image upload).

Read assessment
Edge InfrastructureApr 18, 2026

Hono.js on Cloudflare Workers: Typed Edge APIs

A developer describes migrating an AI agent webhook layer from an Express server on Fly.io to Hono running on Cloudflare Workers. Hono is a lightweight web framework built around the standard Request/Response Web Fetch API and supports multiple runtimes (Workers, Deno, Bun, Node). Key benefits covered include end-to-end TypeScript typings via a Bindings generic, typed middleware and variables, compile-time typed client generation via hono/client, and native streaming support for AI responses. The post highlights practical deployment files (package.json, wrangler.toml), runtime limitations (no Node built-ins, free-tier cold starts, bundle size limits) and production performance numbers showing lower median and tail latency after migration. Recommended use cases are webhooks, API proxies, auth layers and hybrid static/dynamic sites.

Read assessment

Track Real-Time Market Signals & Shifts

Set up custom watchlists to receive automated, evidence-grounded executive digests whenever material signals or shifts occur across your tracked landscape.