Skip to content

Fix NavLink crash on undefined href for DocMeta items - #19

Closed
laugharn wants to merge 1 commit into
visible:mainfrom
laugharn:fix/navlink-undefined-href
Closed

Fix NavLink crash on undefined href for DocMeta items#19
laugharn wants to merge 1 commit into
visible:mainfrom
laugharn:fix/navlink-undefined-href

Conversation

@laugharn

Copy link
Copy Markdown

Summary

  • NavLink crashed with Cannot read properties of undefined (reading 'startsWith') when DocMeta items (which have slug but no href) reached the component at runtime
  • Normalizes href to "#" when falsy, so startsWith and the Next.js Link component both receive a valid string

Test plan

  • Verify navigation renders without errors when SidebarSection.items includes DocMeta entries
  • Verify internal and external links still work correctly
  • Verify active link highlighting still functions

🤖 Generated with Claude Code

…tems

NavLink crashed with "Cannot read properties of undefined (reading 'startsWith')"
when DocMeta items without an href property reached the component. Normalize href
to "#" when falsy so startsWith and the Link component both receive a valid string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 31, 2026

Copy link
Copy Markdown

@laugharn is attempting to deploy a commit to the birthstone Team on Vercel.

A member of the Team first needs to authorize it.

@keypad

keypad commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

fixed in #22

@keypad keypad closed this Apr 6, 2026
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.

2 participants