vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.02k stars 26.99k forks source link

[turbopack] nav links do not redirect / work _after_ visiting root `not-found.js` #50410

Closed padmaia closed 11 months ago

padmaia commented 1 year ago

Summary : nav links do not redirect / work after visiting root not-found.js

(next v13.3.0; react v18.2; node v16.19.1; turbo enabled)

I have a chakra-ui client component that wraps my root nav within app/layout.js. I'm seeing that...

In devtools console I see a 404 error per screenshot below.

To try and rule out chakra-ui / client component being the cause, I created a noddy simple nav within app/layout.js (copied below) however this had the same result.

Is this a bug or a "user error" ?

Tks vm

app/not-found.js ....

import Link from "next/link";

export default function NotFound() {
  return (
    <>
      <h1>404 !</h1>
      <p>Could not find requested resource</p>
      <p><Link href="/">Please click this link to return to home</Link></p>
    </>
  );
}

then my noddy simple nav in app/layout.js ...

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <nav>
          <Link href="/">Home</Link>
          <Link href="/projects">Projects</Link>
          <Link href="/contact">Contact</Link>
        </nav>
        {children}
      </body>
    </html>
  )
}

nextjx13-navlink-error-console

Originally posted by @AC90 in https://github.com/vercel/turbo/discussions/2312#discussioncomment-5636282

WEB-1120

kotx commented 1 year ago

I also have this issue, but the same issue happens navigating to a not-found page. Page url changes but nothing else happens. image

JamDev0 commented 1 year ago

Same here

CaterJ commented 1 year ago

Also experiencing this. Page links work on not-found.js, but the links in my nav component change URL with no UI change.

GrzegorzZajac000 commented 1 year ago

Same here with webpack. router.push also doesn't work

padmaia commented 1 year ago

@AC90 @kotx @JamDev0 @CaterJ can y'all confirm if you are still seeing this with the most recent version? Also are you all seeing it with just Turbopack, or seeing it with webpack as well?

tizips commented 1 year ago

next v13.5.6

I have encountered the same problem and have started using instead of to avoid it

ForsakenHarmony commented 11 months ago

Can't reproduce with Next.js 14, will close this for now.

If you're still running into this, please open a new issue with a reproduction link.

github-actions[bot] commented 11 months ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.