Skip to content

Commit a433b9b

Browse files
TheDSCPLTimer
andauthored
Fix bug in catch-all routes with SSG (#10379)
* Fix bug in catch-all routes with SSG * fix slash Co-authored-by: Joe Haddad <[email protected]>
1 parent e90af3f commit a433b9b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/next/build/utils.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,9 @@ export async function isPageStatic(
592592

593593
builtPage = builtPage.replace(
594594
`[${repeat ? '...' : ''}${validParamKey}]`,
595-
encodeURIComponent(
596-
repeat
597-
? (paramValue as string[]).join('/')
598-
: (paramValue as string)
599-
)
595+
repeat
596+
? (paramValue as string[]).map(encodeURIComponent).join('/')
597+
: encodeURIComponent(paramValue as string)
600598
)
601599
})
602600

test/integration/prerender/test/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const expectedManifestRoutes = () => ({
109109
initialRevalidateSeconds: false,
110110
srcRoute: null,
111111
},
112-
'/catchall/another%2Fvalue': {
113-
dataRoute: `/_next/data/${buildId}/catchall/another%2Fvalue.json`,
112+
'/catchall/another/value': {
113+
dataRoute: `/_next/data/${buildId}/catchall/another/value.json`,
114114
initialRevalidateSeconds: 1,
115115
srcRoute: '/catchall/[...slug]',
116116
},

0 commit comments

Comments
 (0)