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

Catch-All path overrides Index path on the client #10944

Closed
ivan-kleshnin opened this issue Mar 10, 2020 · 3 comments
Closed

Catch-All path overrides Index path on the client #10944

ivan-kleshnin opened this issue Mar 10, 2020 · 3 comments
Milestone

Comments

@ivan-kleshnin
Copy link
Contributor

ivan-kleshnin commented Mar 10, 2020

Bug report

Describe the bug

During the client-side navigation to /en URL which corresponds to pages/[lang]/index.js lambda

pages/[lang]/[...slugs].js is called with empty slugs instead of pages/[lang]/index.js.

It happens only in production mode (after Zeit builds). It also concerns only getServerSideProps triggered from the client-side navigation (clicks on Link).

The same code works fine with now build && now start and now dev on the local machine.

Probably related to: #10488

Expected behavior

pages/[locale]/index.js should always override pages/[locale]/[...catchAll].js route if both are present.

Demonstration

👉 Video proof: https://youtu.be/ZVwAj-TEWSI (~2 mins)

System information

Next 9.3
I didn't have this problem with Next 9.2

For the sake of completeness tried:

import NextLink from "next/link"

function TopMenu() {
  return <>
    <NextLink href="/[lang]" as="/en">
      <a>Home</a>
    </NextLink>

    <NextLink href="/[lang]/" as="/en/">
      <a>Home</a>
    </NextLink>
  </>
}

Both work fine on the local machine and both cause 500 error related to empty slugs in pages/[lang]/[...slugs].js in production.

@Timer Timer added this to the 9.3.1 milestone Mar 11, 2020
@Timer Timer modified the milestones: 9.3.1, 9.3.2 Mar 18, 2020
@Timer Timer modified the milestones: 9.3.2, 9.3.3, 9.3.4 Mar 27, 2020
@Timer Timer modified the milestones: 9.3.4, 9.3.5 Apr 3, 2020
@Timer Timer modified the milestones: 9.3.5, 9.3.6 Apr 15, 2020
@Timer Timer modified the milestones: 9.3.6, 9.3.x Apr 28, 2020
@lachlanjc
Copy link
Contributor

More activity/related: #19270

@ijjk
Copy link
Member

ijjk commented Jan 8, 2021

Hi, this appears to be working correctly on the latest version of Next.js v10.0.5, as can be seen on this deployment https://test-index-mas20ojrb.vercel.app/ please update to the latest version and give it a try!

@ijjk ijjk closed this as completed Jan 8, 2021
@Timer Timer modified the milestones: 10.x.x, iteration 15 Jan 8, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants