Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix splitting page path by buildId (#19901)
Running next.js in `development` causes issues when having pages named "development" or "developments",... as `this.buildId` = `development` Fixes: #19520
- Loading branch information
1 parent
d33aad7
commit 72ce099
Showing
4 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/integration/i18n-support-base-path/pages/developments/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Link from 'next/link' | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
|
||
return ( | ||
<> | ||
<p id="developments">developments page</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
<p id="router-locale">{router.locale}</p> | ||
<p id="router-default-locale">{router.defaultLocale}</p> | ||
<p id="router-locales">{JSON.stringify(router.locales)}</p> | ||
<p id="router-query">{JSON.stringify(router.query)}</p> | ||
<p id="router-pathname">{router.pathname}</p> | ||
<p id="router-as-path">{router.asPath}</p> | ||
<Link href="/"> | ||
<a id="to-index">to /</a> | ||
</Link> | ||
<br /> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = ({ locale, locales, defaultLocale }) => { | ||
return { | ||
props: { | ||
locale, | ||
locales, | ||
defaultLocale, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Link from 'next/link' | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
|
||
return ( | ||
<> | ||
<p id="developments">developments page</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
<p id="router-locale">{router.locale}</p> | ||
<p id="router-default-locale">{router.defaultLocale}</p> | ||
<p id="router-locales">{JSON.stringify(router.locales)}</p> | ||
<p id="router-query">{JSON.stringify(router.query)}</p> | ||
<p id="router-pathname">{router.pathname}</p> | ||
<p id="router-as-path">{router.asPath}</p> | ||
<Link href="/"> | ||
<a id="to-index">to /</a> | ||
</Link> | ||
<br /> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = ({ locale, locales, defaultLocale }) => { | ||
return { | ||
props: { | ||
locale, | ||
locales, | ||
defaultLocale, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters