Skip to content

Conversation

@CarolinaMoraes
Copy link
Contributor

@CarolinaMoraes CarolinaMoraes commented Nov 21, 2025

Summary by cubic

Switch external rewrite links to a plain anchor to fix broken navigation to docs on Next.js 16. Replaces Next’s Link in the menu with a SmartLink that falls back to Link for internal routes.

  • Bug Fixes
    • Add SmartLink: uses for paths like /docs, otherwise uses Next Link.
    • Replace Link with SmartLink in the menu to prevent failed navigation to external docs.

Written for commit 4d2ef6d. Summary will update automatically on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2025

⚠️ No Changeset found

Latest commit: 4d2ef6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CarolinaMoraes CarolinaMoraes self-assigned this Nov 21, 2025
@vercel
Copy link

vercel bot commented Nov 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-email Ready Ready Preview Comment Nov 21, 2025 4:25pm
react-email-demo Ready Ready Preview Comment Nov 21, 2025 4:25pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 21, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email/@react-email/preview-server@2707
npm i https://pkg.pr.new/resend/react-email@2707

commit: b11f69e

@gabrielmfern gabrielmfern merged commit 7b5f27b into canary Nov 21, 2025
14 checks passed
@gabrielmfern gabrielmfern deleted the fix/use-a-tag-for-external-rewrites branch November 21, 2025 16:26
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="apps/web/src/components/smart-link.tsx">

<violation number="1" location="apps/web/src/components/smart-link.tsx:19">
`SmartLink` accepts UrlObject `href`s but the external rewrite check only handles strings, so `/docs` rewrites expressed as UrlObjects never hit the `&lt;a&gt;` fallback and the router bug remains.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

* https://resend.slack.com/archives/C05R55V6GBF/p1763739968845719?thread_ts=1763732012.356639&cid=C05R55V6GBF
*/
export function SmartLink({ href, ...props }: SmartLinkProps) {
const isExternalRewrite =
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SmartLink accepts UrlObject hrefs but the external rewrite check only handles strings, so /docs rewrites expressed as UrlObjects never hit the <a> fallback and the router bug remains.

Prompt for AI agents
Address the following comment on apps/web/src/components/smart-link.tsx at line 19:

<comment>`SmartLink` accepts UrlObject `href`s but the external rewrite check only handles strings, so `/docs` rewrites expressed as UrlObjects never hit the `&lt;a&gt;` fallback and the router bug remains.</comment>

<file context>
@@ -0,0 +1,28 @@
+ * https://resend.slack.com/archives/C05R55V6GBF/p1763739968845719?thread_ts=1763732012.356639&amp;cid=C05R55V6GBF
+ */
+export function SmartLink({ href, ...props }: SmartLinkProps) {
+  const isExternalRewrite =
+    typeof href === &#39;string&#39; &amp;&amp;
+    EXTERNAL_REWRITE_PATHS.some((path) =&gt; href.startsWith(path));
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants