-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
middleware size extremely large on build #599
Comments
I've dug around a bit more and it appears to be a Nextjs issue after all -- its bundling things it shouldn't be with the middleware for some reason. Closing! |
Thanks for investigating! Can you link to the issue on the Next.js side? |
@amannn @t2pellet I think this needs to be reopened. It is not nextjs, it is the fact that we are including messages on every request in the i18n configuration of Next Intl. Basically, when you write export default getRequestConfig(async ({ locale }) => { Where you import JSON files, those JSON files are bundled by webpack, since you explicitly ask us to import them. This is causing the bloat in middleware size – this is not a NextJS problem, it's a next-intl problem! |
Let's continue the discussion in #814 |
Description
Hi, I was trying to deploy my Next.js site on Vercel, and its failing due to the middleware.ts file being too big:
I tried looking around a bit and couldn't seem to grasp why the middleware would need to be that large.
My middleware is purely just the
next-intl
middleware, nothing else:I'm using:
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://github.com/t2pellet/tenzin.live
Reproduction description
Steps to reproduce:
next-intl
middleware inmiddleware.ts
Expected behaviour
The middleware.ts file should be a smaller/more reasonable size
The text was updated successfully, but these errors were encountered: