Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] next 15.2.0 breaks non static routes #432

Closed
makepanic opened this issue Mar 2, 2025 · 8 comments · Fixed by #441
Closed

[BUG] next 15.2.0 breaks non static routes #432

makepanic opened this issue Mar 2, 2025 · 8 comments · Fixed by #441
Labels
bug Something isn't working triage

Comments

@makepanic
Copy link

Describe the bug

I've upgraded my app to next 15.2.0 and now i'm getting a 500 on some routes.

From a quick check it seems to only happen on the routes that don't use generateStaticParams

✘ [ERROR] ⨯ Error: Invariant: renderHTML should not be called in minimal mode

      at Object.renderHTMLImpl
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at <unknown>
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at Object.trace
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at Object.renderHTML
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at doRender
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at responseGenerator
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at Object.get
  (/path/to/proj/.wrangler/tmp/dev-Cd8zgp/worker.js)
      at Object.renderToResponseWithComponentsImpl

Versions of opennext/next/vercel:

"next": "^15.2.0",
"@opennextjs/aws": "^3.5.0",
"@opennextjs/cloudflare": "^0.5.7",
"vercel": "^41.3.0",

Steps to reproduce

  1. create a route without generateStaticParams
  2. run opennextjs-cloudflare && wrangler dev
  3. open in browser and see error 500

Expected behavior

  1. no 500 should be thrown for non static routes

@opennextjs/cloudflare version

0.5.7

Wrangler version

3.111.0

next info output

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu, 27 Feb 2025 18:09:44 +0000
  Available memory (MB): 31302
  Available CPU cores: 16
Binaries:
  Node: 20.18.2
  npm: 10.8.2
  Yarn: 1.22.19
  pnpm: 10.1.0
Relevant Packages:
  next: 15.2.0 // Latest available version is detected (15.2.0).
  eslint-config-next: 15.2.0
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

Additional context

No response

@makepanic makepanic added bug Something isn't working triage labels Mar 2, 2025
@slawton3
Copy link

slawton3 commented Mar 3, 2025

+1 getting this too

@LubomirGeorgiev
Copy link

+1 I am also getting this error

@twoolworth
Copy link

Also receiving this issue, I'm trying to use dynamic routes.

This page works at /app/static/page.tsx:

export default function StaticPage() {
    return <h1>This is a static page</h1>;
}

This page never works regardless of whether I make it client side, here's an example of client side at /app/static/[id]/page.tsx:

'use client';
import { useParams } from 'next/navigation';

export default function StaticIdPage() {
    const params = useParams<{ id: string }>();

    return <h1>Static Page: {params.id}</h1>;
}
  • Tried Wrangler version 3.111.0 & 3.112.0
  • Tried @opennextjs/cloudflare version 0.5.7 & 0.5.8

I've tried adding various exports to the top of pages like the following which make no difference:

export const dynamic = 'force-dynamic';
export const runtime = 'nodejs';

I've tried figuring out where the request is dying by running build worker and then updating worker.js to have the following:

console.log('Worker started.');

addEventListener('fetch', (event) => {
  console.log('🔥 Incoming request:', event.request.url);
  
  // Respond immediately so we can see if the worker is running
  event.respondWith(
    new Response('Worker is handling this request.', {
      headers: { 'Content-Type': 'text/plain' }
    })
  );
});

Only "Worker started" is ever logged to the console so I don't even think it got to my page's code.

I've tried completely removing the .open-next folder completely to ensure no stale artifacts from previous versions are causing issues.

I added a middleware.ts file with the following just to log requests, the middleware did log the request hit for the dynamic route but the request seems to die somewhere after the middleware.

import { NextResponse } from 'next/server';

export function middleware(request: Request) {
    console.log('Middleware hit:', request.url);
    return NextResponse.next();
}

@makepanic
Copy link
Author

Same thing happens with the recently released 15.2.1 from the looks of it

@vicb
Copy link
Contributor

vicb commented Mar 5, 2025

I took a quick look at this issue.

One problem is that loadManifest is called ti load /.next/dynamic-css-manifest.json and we don't have this manifest inlined.

@timReynolds
Copy link

Downgrading to 15.1.7 fixed this

@kostandy
Copy link

kostandy commented Mar 6, 2025

Downgrading to 15.1.7 fixed this

Confirm. It works after downgrading to 15.1.7

@twoolworth
Copy link

twoolworth commented Mar 6, 2025

What other versions were you using? I tried deleting my node_modules, .next, and .open-next folder and changing package references to 15.1.7 and was still having the same issue. I'm guessing I'm either doing something different in my project it doesn't like or there's a version of wrangler or open-next that needs to coincide with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
7 participants