Skip to content

Commit

Permalink
Fix bug where pages refresh when they don't start with /
Browse files Browse the repository at this point in the history
  • Loading branch information
Joey committed Mar 29, 2020
1 parent fc94605 commit 169ff62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next/server/on-demand-entry-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ export function normalizePage(page: string) {
if (unixPagePath === '/index' || unixPagePath === '/') {
return '/'
}

if (!unixPagePath.startsWith('/')) {
return '/' + unixPagePath.replace(/\/index$/, '')
}

return unixPagePath.replace(/\/index$/, '')
}

Expand Down

0 comments on commit 169ff62

Please sign in to comment.