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

After adding the middleware, the webpage appears twice #64668

Closed
caixingyue opened this issue Apr 17, 2024 · 2 comments
Closed

After adding the middleware, the webpage appears twice #64668

caixingyue opened this issue Apr 17, 2024 · 2 comments
Labels
bug Issue was opened via the bug report template. locked

Comments

@caixingyue
Copy link

Link to the code that reproduces this issue

https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-ts

To Reproduce

1.download code:
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/material-ui-nextjs-ts

2.install code:
npm i

3.create a middleware to src:
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
return NextResponse.next()
}
export const config = {
matcher: ['/((?!api|_next/static|_next/image|.\.png$).)'],
}

4.open http://localhost:3000/about
5.multiple accesses appear on the terminal
WX20240417-232403@2x

Current vs. Expected behavior

I only ran the page once and got GET /about twice in the terminal

GET /about 200 in 168ms
GET /about 200 in 159ms
GET /favicon.ico 200 in 7ms

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 20.11.0
  npm: 10.5.2
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 14.2.1 // Latest available version is detected (14.2.1).
  eslint-config-next: 14.2.1
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Middleware

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

@caixingyue caixingyue added the bug Issue was opened via the bug report template. label Apr 17, 2024
@samcx
Copy link
Member

samcx commented Apr 17, 2024

@caixingyue This should be fixed in v14.3.0-canary.6! → #64549

@samcx samcx closed this as completed Apr 17, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

This closed issue has been automatically locked because it had no new activity for 2 weeks. 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 added the locked label May 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2024
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. locked
Projects
None yet
Development

No branches or pull requests

2 participants