Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigating back to root of custom domain page leads to a 404. #182

Closed
nicksergeant opened this issue Jan 8, 2023 · 4 comments
Closed

Navigating back to root of custom domain page leads to a 404. #182

nicksergeant opened this issue Jan 8, 2023 · 4 comments

Comments

@nicksergeant
Copy link

I noticed this while writing up #178, but was hoping that it'd be fixed in the final merge of #181

If you navigate to https://demo.vercel.pub/ then click the link for "Announcing our $150M Series D" (https://demo.vercel.pub/150m-series-d), then use your browser's back button, you will get a 404.

Here's a GIF screencast of the bug:

CleanShot 2023-01-08 at 13 54 32

@nicksergeant
Copy link
Author

nicksergeant commented Jan 8, 2023

I was able to manually fix/patch this in my test repo like this in the middleware:

  // Next 13 sometimes appends 'index' to root paths after the page has loaded...
  let pathname = nextUrl.pathname;
  if (nextUrl.pathname === "/index") {
    pathname = "/";
  }

(but, I don't really understand the mechanism deeply enough to know whether this is a poor approach for a fix, or not)

@steven-tey
Copy link
Contributor

Hey Nick! Thanks for reporting this! This is a bug in the Next.js /app directory – the team is aware of it and are actively fixing it now!

@nicksergeant
Copy link
Author

@steven-tey awesome to hear! Let me know if I can help beta test any future potential fixes for this, also 👍

@steven-tey
Copy link
Contributor

Closing this since we've migrated to the App Router as per #221 and this should be fixed now!

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

No branches or pull requests

2 participants