{"record":{"id":"74b4de01073db4f8","repo":"vercel/next.js","slug":"dynamic-href-href-found-in-link-while-using","errorCode":null,"errorMessage":"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","messagePattern":"Dynamic href `(.+?)` found in <Link> while using the `/app` router, this is not supported\\. Read more: https://nextjs\\.org/docs/messages/app-dir-dynamic-href","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/client/app-dir/link.tsx","lineNumber":543,"sourceCode":"    }\n    if (!asProp) {\n      let href: string | undefined\n      if (typeof resolvedHref === 'string') {\n        href = resolvedHref\n      } else if (\n        typeof resolvedHref === 'object' &&\n        typeof resolvedHref.pathname === 'string'\n      ) {\n        href = resolvedHref.pathname\n      }\n\n      if (href) {\n        const hasDynamicSegment = href\n          .split('/')\n          .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n        if (hasDynamicSegment) {\n          throw new Error(\n            `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`\n          )\n        }\n      }\n    }\n  }\n\n  // This will return the first child, if multiple are provided it will throw an error\n  let child: any\n  if (legacyBehavior) {\n    if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n      throw new Error(\n        `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n      )\n    }\n\n    if (process.env.NODE_ENV === 'development') {\n      if (onClick) {","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/client/app-dir/link.tsx#L525-L561","documentation":"LinkComponent throws when an app-router <Link> receives an href containing a dynamic segment like /blog/[slug]. App Router Links must receive concrete, already-resolved URLs; dynamic placeholders are a Pages Router concept and cannot be prefetched or rendered, so they are rejected.","triggerScenarios":"<Link> receives a dynamic href object in the app router.","commonSituations":"Passing a URL object with pathname/query to Link in /app; use a plain string instead.","solutions":["Build the href string before rendering instead of passing a dynamic object href to <Link> in the app router."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}