{"record":{"id":"77c4fca48a278f2a","repo":"vercel/next.js","slug":"onmouseenter-was-passed-to-link-with-href-of","errorCode":null,"errorMessage":"\"onMouseEnter\" was passed to <Link> with `href` of `${formattedHref}` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link","messagePattern":"\"onMouseEnter\" was passed to <Link> with `href` of `(.+?)` but \"legacyBehavior\" was set\\. The legacy behavior requires onMouseEnter be set on the child of next/link","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/client/app-dir/link.tsx","lineNumber":567,"sourceCode":"  }\n\n  // This will return the first child, if multiple are provided it will throw an error\n  let child: any\n  if (legacyBehavior) {\n    if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n      throw new Error(\n        `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n      )\n    }\n\n    if (process.env.NODE_ENV === 'development') {\n      if (onClick) {\n        console.warn(\n          `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n        )\n      }\n      if (onMouseEnterProp) {\n        console.warn(\n          `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n        )\n      }\n      try {\n        child = React.Children.only(children)\n      } catch (err) {\n        if (!children) {\n          throw new Error(\n            `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n          )\n        }\n        throw new Error(\n          `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n            (typeof window !== 'undefined'\n              ? \" \\nOpen your browser's console to view the Component stack trace.\"\n              : '')\n        )\n      }","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/client/app-dir/link.tsx#L549-L585","documentation":"Error \"\"onMouseEnter\" was passed to <Link> with `href` of `${formattedHref}` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link\" thrown in vercel/next.js.","triggerScenarios":"Thrown at packages/next/src/client/app-dir/link.tsx:567 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["With legacyBehavior, put onMouseEnter on the child <a> element, or remove legacyBehavior."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}