Skip to content
Latchkey

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.

remix
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

  1. Pick the adapter for your host: @remix-run/node for a Node server, @remix-run/cloudflare for Workers/Pages, the Vercel preset for Vercel.
  2. Update the server entry and imports to that adapter.
  3. Rebuild and redeploy against the correct target.
server.ts
// 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
// 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.

Frequently asked questions

What causes "Adapter mismatch for deploy target"?
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).
How do I fix Adapter mismatch for deploy target?
Match the adapter to the deploy target

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card