Fix prerendered dynamic ISR functions with catch-all segments #864
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This expands on the change in #834 to fix prerendered routes with catch-all (e.g. blog/[...slug]/page.tsx -> blog/foo and blog/category/bar) routes.
I ran into an issue trying to get timlrx/tailwind-nextjs-starter-blog working on Cloudflare Pages. For the most part, everything worked, but for blog posts in particular, there were two issues: first, somewhere in the stack code is
eval
-ed, so posts cannot be rendered on the edge runtime and must be prerendered. The second: next-on-pages wasn't doing whatever magic it usually does for a typical blog/[slog]/page.tsx, so I was getting an error telling me to addruntime = 'edge'
.This change applies the same fix to
[...param]
routes as it does[param]
routes. I readily admit, I am a backend developer/data engineer not familiar with this codebase, Next.js, Cloudflare Pages, etc. This is working for me, but please validate my assumptions before merging.I released this package on @benmanns/next-on-pages if anyone (like me) wants to use the changes immediately.