From c52225657b56e9bf6f9dbc7c176bde4fe30aac6d Mon Sep 17 00:00:00 2001 From: Carolina de Moraes Josephik Date: Fri, 21 Nov 2025 13:14:11 -0300 Subject: [PATCH 1/4] fix: use element instead of relying on Link for external rewrites --- apps/web/src/components/menu.tsx | 6 +++--- apps/web/src/components/smart-link.tsx | 28 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/components/smart-link.tsx diff --git a/apps/web/src/components/menu.tsx b/apps/web/src/components/menu.tsx index f70bbe5ed8..070090ef8c 100644 --- a/apps/web/src/components/menu.tsx +++ b/apps/web/src/components/menu.tsx @@ -1,10 +1,10 @@ 'use client'; import classnames from 'classnames'; -import Link from 'next/link'; import { usePathname } from 'next/navigation'; import * as React from 'react'; import { Drawer } from 'vaul'; +import { SmartLink } from './smart-link'; interface MenuItemProps { className?: string; @@ -31,7 +31,7 @@ function MenuItem({ className, children, href, onClick }: MenuItemProps) { return (
  • - {children} - +
  • ); } diff --git a/apps/web/src/components/smart-link.tsx b/apps/web/src/components/smart-link.tsx new file mode 100644 index 0000000000..9ca6953a27 --- /dev/null +++ b/apps/web/src/components/smart-link.tsx @@ -0,0 +1,28 @@ +import Link from 'next/link'; +import type { ComponentProps } from 'react'; + +const EXTERNAL_REWRITE_PATHS = ['/docs']; + +type SmartLinkProps = ComponentProps; + + +/** + * We'll temporarily use
    to redirect to external domains -- apparently Next.js 16 has a router regression + * where components try to do client-side navigation for rewritten paths (e.g., /docs -> mintlify.com) + * The router doesn't detect these are external rewrites and attempts to fetch RSC payloads by adding + * ?_rsc= query params (since the external domain doesn't serve RSC payloads, navigation fails) + * + * Context: + * https://resend.slack.com/archives/C05R55V6GBF/p1763739968845719?thread_ts=1763732012.356639&cid=C05R55V6GBF + */ +export function SmartLink({ href, ...props }: SmartLinkProps) { + const isExternalRewrite = + typeof href === 'string' && + EXTERNAL_REWRITE_PATHS.some((path) => href.startsWith(path)); + + if (isExternalRewrite) { + return )} />; + } + + return ; +} From b11f69eb24051e6876b4f5ea5a5fd88ce9dcdde8 Mon Sep 17 00:00:00 2001 From: Carolina de Moraes Josephik Date: Fri, 21 Nov 2025 13:20:13 -0300 Subject: [PATCH 2/4] fix: pass href directly, it's a string already --- apps/web/src/components/smart-link.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/smart-link.tsx b/apps/web/src/components/smart-link.tsx index 9ca6953a27..4c59c0ed42 100644 --- a/apps/web/src/components/smart-link.tsx +++ b/apps/web/src/components/smart-link.tsx @@ -21,7 +21,7 @@ export function SmartLink({ href, ...props }: SmartLinkProps) { EXTERNAL_REWRITE_PATHS.some((path) => href.startsWith(path)); if (isExternalRewrite) { - return )} />; + return )} />; } return ; From 80440e608324bd932e01f5caf32d355755c3f91f Mon Sep 17 00:00:00 2001 From: Carolina de Moraes Josephik Date: Fri, 21 Nov 2025 13:21:42 -0300 Subject: [PATCH 3/4] fix: lint --- apps/web/src/components/smart-link.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/src/components/smart-link.tsx b/apps/web/src/components/smart-link.tsx index 4c59c0ed42..725136368d 100644 --- a/apps/web/src/components/smart-link.tsx +++ b/apps/web/src/components/smart-link.tsx @@ -5,7 +5,6 @@ const EXTERNAL_REWRITE_PATHS = ['/docs']; type SmartLinkProps = ComponentProps; - /** * We'll temporarily use to redirect to external domains -- apparently Next.js 16 has a router regression * where components try to do client-side navigation for rewritten paths (e.g., /docs -> mintlify.com) From 684beb06616ab381e93e7e67a9ddfecffb3f224e Mon Sep 17 00:00:00 2001 From: Carolina de Moraes Josephik Date: Fri, 21 Nov 2025 13:24:06 -0300 Subject: [PATCH 4/4] feat: add vercel issue link --- apps/web/src/components/smart-link.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/src/components/smart-link.tsx b/apps/web/src/components/smart-link.tsx index 725136368d..d03adec292 100644 --- a/apps/web/src/components/smart-link.tsx +++ b/apps/web/src/components/smart-link.tsx @@ -13,6 +13,7 @@ type SmartLinkProps = ComponentProps; * * Context: * https://resend.slack.com/archives/C05R55V6GBF/p1763739968845719?thread_ts=1763732012.356639&cid=C05R55V6GBF + * https://github.com/vercel/next.js/issues/86385 */ export function SmartLink({ href, ...props }: SmartLinkProps) { const isExternalRewrite =