Skip to content

[BUG] Next 16 proxy (former middleware) not supported #962

@fbuireu

Description

@fbuireu

NextJS 16 Proxy file not supported

Looks like the new proxy (new name for middleware in Next 16) file is not supported.

09:23:45.487 | ✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxxx/workers/scripts/xxxxxxx/versions) failed.
-- | --
09:23:45.487 |  
09:23:45.487 | Uncaught TypeError: The argument 'path' The argument must be a file URL object, a file URL string, or an absolute path string.. Received 'undefined'
09:23:45.487 | at null.<anonymous> (node:module:34:15) in createRequire
09:23:45.487 | at null.<anonymous> (file:///opt/buildhome/repo/.open-next/middleware/handler.mjs:1:242)
09:23:45.487 | [code: 10021]
09:23:45.487 | To learn more about this error, visit: https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021

Steps to reproduce

  1. Upgrade to Next 16
  2. Rename middleware.ts (or .js) to proxy.ts (or .js)
  3. Deploy with opennextjs

Expected behavior

I expect to deploy my site without issues

@opennextjs/cloudflare version

1.11.0

Wrangler version

4.44.0

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:52 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T8112
  Available memory (MB): 24576
  Available CPU cores: 8
Binaries:
  Node: 24.6.0
  npm: 11.6.2
  Yarn: 1.22.22
  pnpm: 10.18.3
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions