diff --git a/.changeset/odd-lemons-jog.md b/.changeset/odd-lemons-jog.md new file mode 100644 index 000000000..f78168778 --- /dev/null +++ b/.changeset/odd-lemons-jog.md @@ -0,0 +1,5 @@ +--- +'@cloudflare/next-on-pages': patch +--- + +Fix prerendered dynamic ISR functions with catch-all segments diff --git a/packages/next-on-pages/src/buildApplication/processVercelFunctions/invalidFunctions.ts b/packages/next-on-pages/src/buildApplication/processVercelFunctions/invalidFunctions.ts index d6d92d729..00872adaa 100644 --- a/packages/next-on-pages/src/buildApplication/processVercelFunctions/invalidFunctions.ts +++ b/packages/next-on-pages/src/buildApplication/processVercelFunctions/invalidFunctions.ts @@ -339,7 +339,7 @@ async function tryToFixInvalidDynamicISRFuncs({ const isDynamicISRFunc = fnInfo.config.operationType === 'ISR' && - /\/\[[\w-]+\]$/.test(fnPathWithoutRscOrFuncExt); + /\/\[(?:\.\.\.)?[\w-]+\]$/.test(fnPathWithoutRscOrFuncExt); if (isDynamicISRFunc) { const matchingPrerenderedChildFunc = prerenderedFunctionEntries.find(