Remix adapter mismatch (@remix-run/node vs cloudflare/vercel) in CI
Remix server code is written against a runtime adapter. If the build targets @remix-run/node but you deploy to Cloudflare Workers, Vercel, or an Express server that expects a different adapter, the server entry uses APIs the target does not provide and the deploy fails.
What this error means
The build passes but deploy or start fails with a missing export, an "is not a function" from the server entry, or a Node built-in error on an edge target.
Error: The Cloudflare Pages adapter expects a request handler built with
@remix-run/cloudflare, but the server bundle imports @remix-run/node.Common causes
Server entry built for the wrong runtime
The server field in the Remix config or the server entry imports @remix-run/node, but the platform runs an edge runtime that needs @remix-run/cloudflare (or the Vercel adapter).
A leftover adapter after switching hosts
Migrating deploy targets without updating the adapter leaves a createRequestHandler from the previous runtime in place.
How to fix it
Match the adapter to the deploy target
- Pick the adapter for your host:
@remix-run/nodefor a Node server,@remix-run/cloudflarefor Workers/Pages, the Vercel preset for Vercel. - Update the server entry and imports to that adapter.
- Rebuild and redeploy against the correct target.
// Cloudflare target
import { createRequestHandler } from "@remix-run/cloudflare";Set the server build target explicitly
Configure the server platform so the compiler bundles for the runtime you deploy to instead of defaulting to Node.
// remix.config.js
module.exports = { serverPlatform: "neutral", server: "./server.ts" };How to prevent it
- Choose the adapter that matches your deploy target from the start.
- Update the server entry and adapter together when changing hosts.
- Test a production build against the target runtime, not just local Node.