-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
What is the documentation issue?
Though the pageExtensions documentation does warn about changes to the middleware.js, nothing on the middleware page mentions it. The middleware page is confident that the file must be called "middleware.js" or "middleware.ts", and that's not always correct.
Please copy the pageExtensions warning on the instrumentation documentation to the middleware documentation.
Is there any context that might help us understand?
Next finds pages based on specific naming that's calculated from the pageExtensions. This includes various utility "pages", like middleware and instrumentation. The default extensions list includes "ts" and "js", which means it would find middleware at "middleware.js|ts". However, pageExtensions can be updated in the user's configuration. In the documentation, it uses the examples "page.ts" and "page.js" which would mean middleware must be named "middleware.page.js|ts".
Does the docs page already exist? Please link to it.
No response