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

Root catch-all custom-route should match the root itself #14930

Closed
ijjk opened this issue Jul 7, 2020 · 4 comments
Closed

Root catch-all custom-route should match the root itself #14930

ijjk opened this issue Jul 7, 2020 · 4 comments
Assignees
Labels
Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@ijjk
Copy link
Member

ijjk commented Jul 7, 2020

A catch-all rewrite e.g. { source: '/:path*', destination: '/somewhere' } should match when / is requested, after this is corrected we should investigate disabling strict: true for custom-routes.

We also need to make sure this works on Vercel.

@Timer
Copy link
Member

Timer commented Jul 10, 2020

It seems it's necessary to do this:

/:path*{/}?

Still discussing in this thread:
pillarjs/path-to-regexp#228

@Timer Timer modified the milestones: backlog, 9.x.x Sep 7, 2020
@Timer Timer modified the milestones: 10.x.x, iteration 15 Dec 15, 2020
@Timer Timer unassigned ijjk Dec 15, 2020
kylemac pushed a commit to hashicorp/waypoint that referenced this issue Dec 15, 2020
kylemac added a commit to hashicorp/waypoint that referenced this issue Dec 15, 2020
@timneutkens timneutkens modified the milestones: Iteration 18, Iteration 19 Apr 8, 2021
@timneutkens timneutkens modified the milestones: Iteration 19, Iteration 20 May 3, 2021
@timneutkens timneutkens removed this from the Iteration 21 milestone Jun 21, 2021
@timneutkens timneutkens added this to the Iteration 22 milestone Jun 21, 2021
@NickCrews
Copy link
Contributor

I believe another, maybe more readable alternative is /(.*). Correct me if I'm wrong. Based off https://github.com/leerob/leerob.io/blob/d3cb3af32b4be2a2fd2be5953d3c16d429f25943/next.config.js#L15, which is written by someone who probably knows Next.js pretty well.

@gabeidx
Copy link

gabeidx commented Sep 7, 2021

Upstream pillarjs/path-to-regexp#228 (comment) has been closed with a recommendation that consumers apply a fix themselves:

(…) recommend people put this into logic wrapping this library

What can we expect from NextJS in this case?

@styfle styfle modified the milestones: 11.1.x, 12.0.4 Nov 5, 2021
@timneutkens timneutkens removed this from the 12.0.5 milestone Nov 17, 2021
@timneutkens timneutkens added Navigation Related to Next.js linking (e.g., <Link>) and navigation. and removed priority: p1 labels Nov 18, 2021
preethamrn added a commit to preethamrn/preethamrn.com that referenced this issue Dec 29, 2023
Vercel seems to have issues with interpretting the rewrites correctly so the trailing slash needs to be explicitly added: see vercel/next.js#14930 (comment)
NullSoldier added a commit to iron-fish/website that referenced this issue Feb 5, 2024
NullSoldier added a commit to iron-fish/website that referenced this issue Feb 5, 2024
@samcx samcx removed the kind: bug label Apr 30, 2024
@ijjk
Copy link
Member Author

ijjk commented Sep 24, 2024

Closing as stale

@ijjk ijjk closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants