fe797c1074
Internal suggestion to remove `en-US` from Mozilla urls since MDN is available in multiple languages nowadays it will automatically redirect to the viewer’s language preference. Closes [DX-2076](https://linear.app/vercel/issue/DX-2076/make-external-mozilla-links-language-agnostic-in-nextjs-docs)
16 lines
620 B
Text
16 lines
620 B
Text
---
|
|
title: '`NextResponse.next()` used in a App Route Handler'
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
App Route Handler's do not currently support using the `NextResponse.next()` method to forward to the next middleware because the handler is considered the endpoint to the middleware chain. Handlers must always return a `Response` object instead.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
Remove the `NextResponse.next()` and replace it with a correct response handler.
|
|
|
|
## Useful Links
|
|
|
|
- [`Response`](https://developer.mozilla.org/docs/Web/API/Response)
|
|
- [`NextResponse`](/docs/pages/api-reference/functions/next-server#nextresponse)
|