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

Middleware is not called on client when url is for index.js and contains query parameter #35006

Closed
1 task done
nkzawa opened this issue Mar 3, 2022 · 1 comment · Fixed by #35047
Closed
1 task done
Labels
bug Issue was opened via the bug report template. Middleware Related to Next.js Middleware.

Comments

@nkzawa
Copy link
Contributor

nkzawa commented Mar 3, 2022

Verify canary release

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

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 19.6.0: Thu Jan 13 01:26:33 PST 2022; root:xnu-6153.141.51~3/RELEASE_X86_64
Binaries:
  Node: 16.14.0
  npm: 8.3.1
  Yarn: 1.22.17
  pnpm: N/A
Relevant packages:
  next: 12.1.1-canary.6
  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

Middleware is not called at all on the following case:

# file structure
pages/test/index.js
pages/test/_middleware.js
<Link href="/test?something=1">...</Link>

It's correctly called If there are other middleware like on the top level.

Expected Behavior

Middleware is called

To Reproduce

Create files

pages/test/index.js
pages/test/_middleware.js

On a page, create a navigation like <Link href="/test?something=1"><a>click me</a></Link>

Ensure there is no other middleware and add query to the url to navigate.

@nkzawa nkzawa added the bug Issue was opened via the bug report template. label Mar 3, 2022
@balazsorban44 balazsorban44 added the Middleware Related to Next.js Middleware. label Mar 3, 2022
@kodiakhq kodiakhq bot closed this as completed in #35047 Mar 8, 2022
kodiakhq bot pushed a commit that referenced this issue Mar 8, 2022
…all wit… (#35047)

…h query parameter

Fixes #32655 and fixes #35006

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2022

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 Apr 8, 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. Middleware Related to Next.js Middleware.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants