Skip to contentWe move your site for free: work worth ₪1,999 + VAT, for a limited time
DeployAI
BlockerCode nextjs_node_middleware

Next.js middleware runs on Node.js

What it means

The site is built with Next.js, and the code that runs before every page (middleware) is set to run on Node.js.

Why it stops the deploy

On DeployAI that setup is still experimental: every visitor whose browser holds a cookie gets an error instead of the page, on every page of the site.

How to fix it

  1. Your agent moves the same code to middleware.ts, which runs here without a problem.
  2. Run the check again.

Prompt for your agent

Copy it and paste it into your agent. It fixes the site, explains each step, and runs the check again.

DeployAI check found this in the project: Next.js middleware runs on Node.js.
Keep the same logic on the edge runtime: rename proxy.ts to middleware.ts (in the same folder), rename the exported proxy function to middleware, keep its config and matcher, and remove any runtime: "nodejs" from that config. Next.js 16 still runs middleware.ts. Do not use Node.js only APIs (fs, child_process) inside it.
Explain your plan and wait for my approval before architectural changes. Do not remove features without asking.
Write to me briefly, in simple words.
When done, run: npx deployai@latest check