Next.js middleware has graduated from the Edge runtime. With Fluid Compute, your
middleware now runs on full Node.js, same global regions, same pricing, zero
runtime restrictions.
What was wrong with Edge middleware
Edge functions ran on a limited JavaScript subset. You couldn't:
- Use Node.js built-in modules (
crypto, fs, path)
- Import most npm packages that depend on Node.js APIs
- Access environment variables through
process.env in some cases
- Use async context tracking (AsyncLocalStorage)
What Fluid Compute changes
Fluid Compute runs standard Node.js in Vercel's edge network. Your middleware
gets:
- Full Node.js API surface,
crypto, fs, zlib, everything
- All npm packages, no more "this package doesn't support Edge"
- Global distribution, same 18+ regions as Edge
- Same pricing, no premium for compatibility
- Instance reuse, warm starts across concurrent requests, not cold per-request
Real-world impact
Auth
// Now works in middleware:
import { jwtVerify } from 'jose' // uses Node crypto
const { payload } = await jwtVerify(token, secret)
Feature flags
// AsyncLocalStorage for request-scoped context:
import { AsyncLocalStorage } from 'node:async_hooks'
Geo-routing
// Access the full geo object, no Edge-specific APIs:
const country = request.geo?.country
The migration
If you're on Edge middleware today: your existing code keeps working. Fluid
Compute is a superset. If you're starting fresh: write standard Node.js, no
special runtime knowledge needed.