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

using middleware with base path #38528

Closed
1 task done
magsout opened this issue Jul 11, 2022 · 3 comments · Fixed by #40566
Closed
1 task done

using middleware with base path #38528

magsout opened this issue Jul 11, 2022 · 3 comments · Fixed by #40566
Labels
bug Issue was opened via the bug report template.

Comments

@magsout
Copy link

magsout commented Jul 11, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64
Binaries:
  Node: 16.15.1
  npm: 8.11.0
  Yarn: 1.22.19
  pnpm: N/A
Relevant packages:
  next: 12.2.2
  eslint-config-next: 12.2.2
  react: 17.0.2
  react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

I added in my next config a basePath. I use the middleware example here https://nextjs.org/docs/advanced-features/i18n-routing for adding the default locale. by doing this all pages with a query are empty. If I remove the middleware everything works.

Expected Behavior

  • redirection works fine

Link to reproduction

https://github.com/magsout/repro-middleware-nextjs

To Reproduce

if you comment the middleware, no issue at all.

@magsout magsout added the bug Issue was opened via the bug report template. label Jul 11, 2022
@samuelcole
Copy link

I think this might be what I'm seeing! I walked through the code and found that 12.1.7 introduced some logic that removed the query params, and downgrading to 12.1.6 fixed it for me: d959d28#r83332647

@samuelcole
Copy link

just checked: this error still occurs in 12.3.0 (which makes sense, since it was still present in canary), but i was hoping because router changes were in the release log

samuelcole referenced this issue Sep 8, 2022
* Ensure client cache keys match between prefetch and transition

* handle some middleware cases

* lint-fix

* fix lint rename
kodiakhq bot pushed a commit that referenced this issue Sep 15, 2022
…sePath option is truthy (#40566)

## Bug

- [x] Related issues linked using `fixes #number`
    - fixes 
        - #38528 
        - #40432
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Hi, it is my first pull request in this project.
So... if you need anything more tasks, please tell me.

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
@ijjk ijjk closed this as completed Sep 15, 2022
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
3 participants