Skip to content

[BUG] ISR with Partial Prerendering fails at runtime on Cloudflare R2 #662

Description

@pbrissaud

Describe the bug

When deploying a Next.js App Router app using open-next to Cloudflare Workers with R2 object storage as the cache backend, ISR pages using Partial Prerendering (◐) work initially but break after the some times (like 24h ; revalidation period is 1h):

Example of the page :

// app/challenge/[slug].tsx

export const revalidate = 3600;

export async function generateStaticParams() {
  const posts = await getPosts()
  return posts.map((post) => ({ slug: post.slug }));
}

export default async function Page({ params }: { params: { slug: string } }) {
  const awaitedParams = await params;
  const { slug } = awaitedParams as { slug: string }; 
  const post = getPost(slug);

  if (!post) {
    return <h1>404</h1>;
  }

  return (
    <div className="p-8 space-y-4">
      <h1 className="text-3xl font-bold">{post.title}</h1>
      <p>{post.content}</p>

      <Suspense fallback={<p>Loading dynamic content...</p>}>
        <DynamicContent />
      </Suspense>
    </div>
  );
}

The build correctly shows ◐ and the page works at first.

However, after sometimes , the route fails at runtime with:

FatalError: The revalidation for /challenge/[slug] cannot be done. This error should never happen.

After this happens:

  • The Suspense fallback spins indefinitely
  • Refreshing the page leads to a white screen
  • No regeneration ever occurs again

Steps to reproduce

  1. Use App Router in Next.js (v14) with open-next

  2. Create a route with:

    • Static content loaded
    • A section
  3. Deploy with opennextjs-cloudflare build && opennextjs-cloudflare deploy to Cloudflare Workers

  4. Visit the page → it works

  5. Wait many hours

  6. Refresh the page → it fails to revalidate and breaks with the error shown above

Expected behavior

I expect that the route should be revalidated and regenerated after the revalidate interval

@opennextjs/cloudflare version

1.0.2

Wrangler version

4.14.4

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:46 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T8112
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.15.1
  npm: 10.7.0
  Yarn: 1.22.22
  pnpm: 10.10.0
Relevant Packages:
  next: 15.4.0-canary.30 // There is a newer canary version (15.4.0-canary.31) available, please upgrade! 
  eslint-config-next: 15.4.0-canary.30
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.2.2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions