Error AtlasError Documentation and Resolution

Next.js Link wrapper is missing passHref

Link `passHref`

Next.js detected a Link wrapping a custom anchor-like component without passHref, which prevents the child anchor from receiving the href attribute.

Link passHrefruntime
Link `passHref`
  • A custom component wrapping an anchor is used inside next/link without passHref.
  • A styled anchor component is nested under Link but does not receive href.
  • Legacy Link behavior is being used without the compatibility props.
  1. Add passHref to the Link when it wraps a custom anchor-like component.
  2. Use legacyBehavior when required for compatibility with child anchor patterns.
  3. Confirm the custom component forwards anchor props correctly.
Next.js Docs: Link passHref
Next.js Link passHref error: causes and fixes | Error Atlas