Replies: 2 comments 4 replies
-
Hey @levipadre and thanks for the question! I noticed this too recently, it seems like after a Next.js release the size of the middleware grew significantly. If I'm not mistaken, this happened when dynamic open graph image generation was released. I didn't have time to verify this yet or analyze where/how this can be fixed—this might just be a bug on the Next.js side. In case you manage to find the cause of this, it would be helpful if you could share it here! |
Beta Was this translation helpful? Give feedback.
-
Same thing is happening for me.. after upgrading from
import { type NextFetchEvent, type NextRequest } from 'next/server';
import createMiddleware from 'next-intl/middleware';
import { routing } from '@/i18n/routing';
import { CustomMiddleware } from './chain';
const handleI18nRouting = createMiddleware(routing);
export function i18nMiddleware(middleware: CustomMiddleware) {
return async (request: NextRequest, event: NextFetchEvent) => {
// The first middleware in the chain has to create the response
// object and pass it down the chain.
const response = handleI18nRouting(request);
// Call the next middleware and pass the request and response
return middleware(request, event, response);
};
} here are changes for old to new next-intl:
|
Beta Was this translation helpful? Give feedback.
-
Is this a problem?

I have a simple middleware for different domains:
Beta Was this translation helpful? Give feedback.
All reactions