mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## Why? In `next dev`, `404` errors are returned for dynamic routes that contain characters that should be URI encoded in the path. The `404`s are not present in `next build`. ## How? We're failing to decode the [`resolvedUrlPathname`](https://github.com/vercel/next.js/blob/ffec1d3a458056a4531e6b35518fca28bf9c3943/packages/next/src/server/base-server.ts#L2897) in `next dev`, resulting in a `404`. So we add the same decoding logic in development. - Fixes https://github.com/vercel/next.js/issues/63002
22 lines
328 B
TypeScript
22 lines
328 B
TypeScript
export const dynamicParams = false
|
|
|
|
export default async function Page({
|
|
params,
|
|
}: {
|
|
params: Promise<{ id: string }>
|
|
}) {
|
|
const id = (await params).id
|
|
|
|
return (
|
|
<main>
|
|
<div>params.id is {id}</div>
|
|
</main>
|
|
)
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
const id = 'sticks & stones'
|
|
|
|
return [{ id }]
|
|
}
|