You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/next/errors.json
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -720,5 +720,10 @@
720
720
"719": "Failed to get source map for '%s'. This is a bug in Next.js",
721
721
"720": "A client prerender store should not be used for a route handler.",
722
722
"721": "Render in Browser",
723
-
"722": "Unable to match pathname to a dynamic route"
724
-
}
723
+
"722": "Unable to match pathname to a dynamic route",
724
+
"723": "Dynamic href \\`%s\\` found in <Link> while using the \\`/app\\` router, this is not supported. Instead, you should use \\`path\\` and \\`params\\` props. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href",
725
+
"724": "Invalid <Link> with neither `href` nor `path` prop. You must provide exactly one of these props.",
726
+
"725": "Invalid <Link> with `params` prop but no `path` prop. `params` can only be used with `path`.",
727
+
"726": "Invalid <Link> with both `href` and `path` props. You must use exactly one of these props.",
728
+
"727": "Invalid <Link> with `searchParams` prop but no `path` prop. `searchParams` can only be used with `path`."
@@ -379,7 +372,7 @@ export default function LinkComponent(
379
372
params,
380
373
searchParams,
381
374
...restProps
382
-
}=propsasany// TypeScript discriminated union handled at type level
375
+
}=props
383
376
384
377
children=childrenProp
385
378
@@ -588,7 +581,7 @@ export default function LinkComponent(
588
581
589
582
if(hasDynamicSegment){
590
583
thrownewError(
591
-
`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`
584
+
`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Instead, you should use \`path\` and \`params\` props. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`
* Optional decorator for the path that will be shown in the browser URL bar. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://github.com/vercel/next.js/blob/v9.5.2/docs/api-reference/next/link.md#dynamic-routes) to see how it worked. Note: when this path differs from the one provided in `href` the previous `href`/`as` behavior is used as shown in the [previous docs](https://github.com/vercel/next.js/blob/v9.5.2/docs/api-reference/next/link.md#dynamic-routes).
30
30
*/
@@ -102,54 +102,63 @@ type InternalLinkPropsBase = {
102
102
onNavigate?: OnNavigateEventHandler
103
103
}
104
104
105
-
typeInternalLinkProps=InternalLinkPropsBase&
106
-
(
107
-
|{
108
-
/**
109
-
* The path or URL to navigate to. It can also be an object.
110
-
* Accepts any string for external URLs and backwards compatibility.
0 commit comments