Skip to content

Conversation

sommeeeer
Copy link
Collaborator

@sommeeeer sommeeeer commented Aug 1, 2025

fixes #667

Patch Next >= 15.4 for getIncrementalCache in /next/src/server/route-modules/route-module.ts

Its pretty much the same as in the next-server patch, we just needed to update the rule and filter. These files were affected:

/next/dist/compiled/next-server/app-page.runtime.prod.js
/next/dist/compiled/next-server/pages.runtime.prod.js
/next/dist/compiled/next-server/app-route.runtime.prod.js

We might also have to make a patch for loadCustomCacheHandlers in the same files, however from my testing it seems to be already initialized therefor it will early return and log cache handlers already initialized if you enable NEXT_PRIVATE_DEBUG_CACHE=1. From what I can see it gets initialized in NextServer's loadCustomCacheHandlers beforehand.

Copy link

changeset-bot bot commented Aug 1, 2025

🦋 Changeset detected

Latest commit: 1b77fd6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sommeeeer sommeeeer requested review from conico974 and vicb August 1, 2025 09:05
Copy link

pkg-pr-new bot commented Aug 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@833

commit: 1b77fd6

@sommeeeer sommeeeer marked this pull request as draft August 1, 2025 09:31
@sommeeeer sommeeeer removed request for conico974 and vicb August 1, 2025 09:31
@sommeeeer sommeeeer marked this pull request as ready for review August 1, 2025 20:26
@sommeeeer sommeeeer requested review from conico974 and vicb August 1, 2025 20:28
@sommeeeer
Copy link
Collaborator Author

sommeeeer commented Aug 1, 2025

This one is ready to go. There is atleast one more patch that needs update. If you build the examples/playground15 with [email protected] and this PR you will get this error when you visit http://localhost:8787/isr/hello/dynamic:
✘ [ERROR] TypeError: Class constructor Cache cannot be invoked without 'new

It wont render the correct 500 html page either.

@vicb vicb changed the title add(patch): Make ISR work for Next 15.4 Update the patches for Next 15.4 Aug 4, 2025
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks @sommeeeer

@vicb vicb merged commit c9705e5 into opennextjs:main Aug 4, 2025
7 checks passed
@sommeeeer sommeeeer deleted the patch-isr branch August 4, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Next 15.4+ (Page Router api route fails, ...)

2 participants