You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, next app will require middleware only if certain config param is enabled. For example, the app can record usage only if certain env variable is set.
To avoid execution of middleware that does nothing, it would be nice to allow export "null" or "undefined" middleware that signals Edge Framework to not run middleware at all.
Describe the solution you'd like
If _middleware.ts export undefined or null, next should not run it at all
Describe the feature you'd like to request
In some cases, next app will require middleware only if certain config param is enabled. For example, the app can record usage only if certain env variable is set.
To avoid execution of middleware that does nothing, it would be nice to allow export "null" or "undefined" middleware that signals Edge Framework to not run middleware at all.
Describe the solution you'd like
If
_middleware.ts
exportundefined
ornull
, next should not run it at allDescribe alternatives you've considered
Alternative solution would be like this:
However, in this case middleware is executed all the time, which could increase usage bills, response time etc
The text was updated successfully, but these errors were encountered: