Skip to content

[BUG] No support for proxy.js in Cloudflare Workers #1277

Description

@incognitotgt

Describe the bug

When I try to deploy a project with a proxy.js file, it gives an error that Node.js middleware isn't currently supported. This is even though the file is supposed to be edge unless a Node API is used, which is what I did.

Steps to reproduce

  1. Make a new cloudflare project
  2. add a proxy.ts file with the following content:
import { type NextRequest, NextResponse } from 'next/server';

export default async function proxy(req: NextRequest) {
  return response;
}
  1. Run the deploy step (opennextjs-cloudflare deploy)
  2. Get an error about only edge middleware being supported

Expected behavior

This should build properly as it imports no Node APIs, and is thus edge only.

@opennextjs/cloudflare version

1.19.11

Wrangler version

4.49.0

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:09 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8112
  Available memory (MB): 24576
  Available CPU cores: 8
Binaries:
  Node: 25.5.0
  npm: 11.8.0
  Yarn: 1.22.19
  pnpm: 9.4.0
Relevant Packages:
  next: 16.2.3 // There is a newer version (16.2.7) available, upgrade recommended! 
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions