Error AtlasError Documentation and Resolution

Next.js invalid href passed to Link or router

Invalid href passed to router

Next.js detected a non-internal URL being passed to next/link or router navigation, which is unsupported because the Next.js router is only for internal routes.

Invalid href passed to routerruntime
Invalid href passed to router
  • A next/link component is pointing to an external URL such as https:// or mailto:.
  • Router.push or Router.replace is being used for non-internal navigation.
  • A refactor changed a link target without changing the component used to render it.
  1. Use next/link only for internal Next.js routes.
  2. Use a normal anchor tag for external URLs and non-router protocols.
  3. Replace invalid router navigation calls with window.location or standard links where appropriate.
Next.js Docs: Invalid href passed to router
Next.js Invalid href passed to router: causes and fixes | Error Atlas