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

now.json "rewrites" routes with dynamic params 404 using now dev #3539

Open
wilsonpage opened this issue Jan 10, 2020 · 5 comments
Open

now.json "rewrites" routes with dynamic params 404 using now dev #3539

wilsonpage opened this issue Jan 10, 2020 · 5 comments
Labels
area: dev triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked

Comments

@wilsonpage
Copy link

Reduced test-case:

https://github.com/wilsonpage/zeit-now-next-rewrites-bug

Steps:

  1. Run now dev
  2. Visit http://localhost:3000/hello
  3. Observe world 200 response ✅
  4. Visit http://localhost:3000/hello-regex/john
  5. Observe 404 response ❌
  6. Visit http://localhost:3000/hello-param/john
  7. Observe 404 response ❌
@leo
Copy link
Contributor

leo commented Jan 10, 2020

Thank you for reporting this! We'll take a look.

@styfle styfle added the triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked label Jan 10, 2020
@styfle styfle self-assigned this Jan 10, 2020
kodiakhq bot pushed a commit that referenced this issue Jan 22, 2020
This PR a regression when path segments are used in the query string.

Take a look at the following ASCII Table for why I had to delete certain parts of the parsed url before formatting again.

https://nodejs.org/api/url.html#url_url_strings_and_url_objects

Related to #3539
@mo3rfan
Copy link

mo3rfan commented Dec 20, 2020

This is still broken in vercel dev (21.0.2-canary.3). However, dynamic routes are working for next dev.

@ivan-kleshnin
Copy link

ivan-kleshnin commented Dec 20, 2020

@mo3rfan what functionality vercel dev provides on top of next dev? I've been struggling to understand that for a long time.

@mo3rfan
Copy link

mo3rfan commented Dec 20, 2020

@ivan-kleshnin I use vercel dev because I need to test serverless functions.

@styfle
Copy link
Member

styfle commented Dec 21, 2020

@mo3rfan You only need vercel dev for non-JS functions.

Next.js already supports JS serverless functions using the /pages/api directory called API Routes.

@styfle styfle removed their assignment Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dev triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked
Projects
None yet
Development

No branches or pull requests

6 participants