forked from vercel/next.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing params for i18n optional route in minimal mode (vercel#33896
) This fixes our parsing of params with i18n for optional catch-all routes and ensures a regression test catches this case. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` Fixes: vercel#30631
- Loading branch information
Showing
4 changed files
with
59 additions
and
5 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
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
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
test/production/required-server-files/pages/[slug]/social/[[...rest]].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,25 @@ | ||
export const getStaticProps = ({ params }) => { | ||
return { | ||
props: { | ||
random: Math.random(), | ||
params: params || null, | ||
}, | ||
revalidate: 1, | ||
} | ||
} | ||
|
||
export const getStaticPaths = () => { | ||
return { | ||
paths: [], | ||
fallback: true, | ||
} | ||
} | ||
|
||
export default function Page(props) { | ||
return ( | ||
<> | ||
<p id="page">/[slug]/social/[[...rest]]</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} |