Skip to content

[BUG] Edge runtime causes silent 500 errors instead of build/runtime warning #1028

@zeke

Description

@zeke

Describe the bug

When a route includes export const runtime = "edge", the build succeeds but the deployed route returns a 500 Internal Server Error with no helpful message. The docs say to remove edge runtime declarations, but there's no build-time or runtime warning when they're present.

Steps to reproduce

  1. Create a simple API route with edge runtime:
// src/app/api/health/route.ts
export const runtime = "edge"

export async function GET() {
  return new Response(JSON.stringify({ status: "ok" }), {
    headers: { "Content-Type": "application/json" },
  })
}
  1. Deploy with opennextjs-cloudflare build && opennextjs-cloudflare deploy
  2. Build succeeds, deployment succeeds
  3. Calling the endpoint returns 500 Internal Server Error
  4. Remove export const runtime = "edge", redeploy
  5. Endpoint now returns 200 OK

Expected behavior

Either:

  • Build should fail with a clear error message explaining edge runtime is not supported
  • Or runtime should return a helpful error message instead of a generic 500

@opennextjs/cloudflare version

1.14.3

Wrangler version

4.52.1

next info output

Next.js 16.0.7

Additional context

The silent failure makes debugging difficult. I spent time investigating before discovering the issue was simply the presence of export const runtime = "edge".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions