From 1b61d1f5df3edffbf59bc35214ceb018ee981e37 Mon Sep 17 00:00:00 2001 From: Yoann Moinet <597828+yoannmoinet@users.noreply.github.com> Date: Sun, 28 Aug 2022 23:34:59 +0200 Subject: [PATCH] [docs] Add precision about `pageExtensions` (#40016) Adding a precision because when you change the `pageExtensions` configuration in `next.config.js`, `middleware.ts` isn't recognized anymore. Took me some time to debug this one, not sure if it should be considered a bug or just lack of documentation. I'll let you be the judge of that. ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com> --- docs/advanced-features/middleware.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/advanced-features/middleware.md b/docs/advanced-features/middleware.md index 74454c5470b5..8f65f84a22f1 100644 --- a/docs/advanced-features/middleware.md +++ b/docs/advanced-features/middleware.md @@ -50,6 +50,8 @@ export const config = { } ``` +> **Note** the `pageExtensions` config affects middleware as well, [see related documentation here](/docs/api-reference/next.config.js/custom-page-extensions.md). + ## Matching Paths Middleware will be invoked for **every route in your project**. The following is the execution order: