nextjs - ✅(Solved) Fix middleware matcher is not working as documented [1 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#84307Fetched 2026-04-08 02:19:55
View on GitHub
Comments
3
Participants
3
Timeline
11
Reactions
1
Author
Timeline (top)
commented ×3labeled ×2closed ×1cross-referenced ×1

Error Message

  1. see server crash with error

Fix Action

Fixed

PR fix notes

PR #85343: docs: regexp removed from middleware config

Description (problem / solution / changelog)

Closes https://github.com/vercel/next.js/issues/84307

It seems that the regexp prop is not currently supported in the matcher object (./packages/next/src/build/segment-config/middleware/middleware-config.ts → MiddlewareMatcherInputSchema). Adjusting docs accordingly.

Changed files

  • docs/01-app/03-api-reference/03-file-conventions/proxy.mdx (modified, +1/-3)

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 23.10.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.17.1
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.4
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Oren-Exon/next-middleware-minimal-example

To Reproduce

  1. npm run dev
  2. see server crash with error

Current vs. Expected behavior

currently server is immediately crashing due to supposed unsupported middleware matcher config. however, this config was taken directly from official docs, so it should be supported and not crash the server.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 23.10.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.17.1
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.4
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
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), next build (local)

Additional context

No response

extent analysis

TL;DR

  • Verify the middleware configuration against the official Next.js documentation for version 15.5.4 to ensure it matches the expected format and supported features.

Guidance

  • Review the next-middleware-minimal-example code to ensure the middleware matcher config is correctly implemented as per the official documentation.
  • Check for any recent updates or changes in the Next.js middleware configuration syntax that might have been introduced in version 15.5.4.
  • Test the server with a minimal middleware configuration to isolate the issue and identify if it's specific to the current config or a broader problem.
  • Consider creating a minimal reproducible example to test the middleware configuration in isolation from the rest of the project code.

Example

No specific code example can be provided without modifying the original code, but it's recommended to compare the middleware configuration in the next-middleware-minimal-example with the official Next.js documentation examples.

Notes

  • The issue might be due to a misunderstanding of the middleware configuration syntax or an unsupported feature in the current version of Next.js.
  • Without more information about the specific error message or the middleware configuration code, it's difficult to provide a more precise solution.

Recommendation

  • Apply workaround: Review and adjust the middleware configuration to match the official documentation and supported features in Next.js version 15.5.4, as this is likely to resolve the immediate issue of the server crashing due to an unsupported middleware matcher config.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING