proxy-new-signature.mdx


title: Deprecated Proxy API Signature

Why This Error Occurred

Your application is using a Proxy function that is using parameters from the deprecated API.

import { NextResponse } from 'next/server'

export function proxy(event) {
  if (event.request.nextUrl.pathname === '/blocked') {
    event.respondWith(
      new NextResponse(null, {
        status: 403,
      })
    )
  }
}

Possible Ways to Fix It

Update to use the new API for Proxy:

import { NextResponse } from 'next/server'

export function proxy(request) {
  if (request.nextUrl.pathname === '/blocked') {
    return new NextResponse(null, {
      status: 403,
    })
  }
}

Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.

errors/proxy-new-signature.mdx · vercel/next.js | Docs MD