Skip to content

Commit

Permalink
Fix bug in catch-all routes with SSG (vercel#10379)
Browse files Browse the repository at this point in the history
* Fix bug in catch-all routes with SSG

* fix slash

Co-authored-by: Joe Haddad <timer150@gmail.com>
  • Loading branch information
2 people authored and chibicode committed Feb 11, 2020
1 parent 34f51c0 commit 3bda7b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions packages/next/build/utils.ts
Expand Up @@ -592,11 +592,9 @@ export async function isPageStatic(

builtPage = builtPage.replace(
`[${repeat ? '...' : ''}${validParamKey}]`,
encodeURIComponent(
repeat
? (paramValue as string[]).join('/')
: (paramValue as string)
)
repeat
? (paramValue as string[]).map(encodeURIComponent).join('/')
: encodeURIComponent(paramValue as string)
)
})

Expand Down
4 changes: 2 additions & 2 deletions test/integration/prerender/test/index.test.js
Expand Up @@ -109,8 +109,8 @@ const expectedManifestRoutes = () => ({
initialRevalidateSeconds: false,
srcRoute: null,
},
'/catchall/another%2Fvalue': {
dataRoute: `/_next/data/${buildId}/catchall/another%2Fvalue.json`,
'/catchall/another/value': {
dataRoute: `/_next/data/${buildId}/catchall/another/value.json`,
initialRevalidateSeconds: 1,
srcRoute: '/catchall/[...slug]',
},
Expand Down

0 comments on commit 3bda7b8

Please sign in to comment.