-
-
Notifications
You must be signed in to change notification settings - Fork 291
Middleware size is affected by messages in Next.js 15 #1669
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
Comments
Thank you for your report! Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically. Templates: Creating a good reproduction takes time. To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you. Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:
Thank you for your understanding! FAQ"I've included a reproduction, what is missing?" This comment might have been added because your reproduction doesn't point to a destination where the issue can be reproduced. Please make sure that the latest changes were saved in the reproduction and that the link is correct. |
I'm sorry. Here's the reproduction link: https://github.com/polly3d/next-intl-json Hope it's helpful. And let me know if anything else you need. |
Thanks for the reproduction! It seems like Next.js 15 has changed something with the bundling behavior, I need to dig a bit deeper and potentially create a bug report upstream. I've confirmed that with Next.js 14 this is not the case. As a quick fix, you can split this out from your // i18n/navigation.ts
import {createNavigation} from 'next-intl/navigation';
import {routing} from './routing';
export const {Link, redirect, usePathname, useRouter, getPathname} =
createNavigation(routing); With this, your middleware size will not be affected anymore. |
I've talked to the Next.js team via DM and they confirmed suspicious behavior in Next.js here. I've added an upstream report here: vercel/next.js#75180. As a workaround for the time being, please consider #1669 (comment). |
Thank you so much for your quick help! It's fixed. |
Sure, you're welcome! I'll leave the issue open as I'm currently waiting for the Next.js team to hopefully address this upstream. |
Fixes #1587 Note that #1669 is still relevant, therefore you might want to use a [workaround](#1669 (comment)) for the time being.
Description
I got an error when I deploy to Vercel. The error is: The Edge Function "src/middleware" size is 1.65 MB and your plan size limit is 1 MB. All translations are packaged into a middleware file.
I know, my translation file was big. Is there any solution for this?
Here's the screenshot of the translation files:
Here's the configuration in i18n folder:
The middleware:
Verifications
Mandatory reproduction URL
None
Reproduction description
None
Expected behaviour
Reduce middleware file size
The text was updated successfully, but these errors were encountered: