-
Notifications
You must be signed in to change notification settings - Fork 28k
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
NextJS build always going out of heap memory when building #76704
Comments
I would advise you firstly to cancel that service account, delete from your repo and add to .gitignore so you can make a new one. Anyone can have access to your firestore, firebase auth or any kind of firebase service that you have right now for this project. |
Yeah, I know, but thats not a production environment. But I wall add it to gitignore. Thank you! |
This comment has been minimized.
This comment has been minimized.
Yes, I actually found a workaround, if you add the following experimental feature to the config it will use less RAM. import type { NextConfig } from "next"; const nextConfig: NextConfig = { export default nextConfig; |
@Falling12 i try your implementation but didn't work. My error occurs on checking type validity of the build part. Thanks anyway |
This issue is also happening for me during the linting/type checking part. Fine on nextjs 14.
|
@nickythorne I identified the solution for my case and the error was happening because I had installed different versions of zod for each of the packages I have in my monorepo.
const nextConfig: NextConfig = {
//some other configuration
eslint: {
ignoreDuringBuilds: true,
},
}
pnpm up -r zod The solution to my memory leak problem was this. |
@ericmesmo Thanks, I double checked the Suspiciously there is this related open bug in the typescript repo: microsoft/TypeScript#60166. So it might not be a nextjs issue (for my case at least). Thanks again for the insights! EDIT: downgrading |
I have also been troubled by this problem for a week. Updating the TypeScript version is not work for me |
Have you tried disabling esmExternals in your next.config.ts? I have sent an example above, maybe it will work for you too. |
Yes, I set it, but it's not useful to me. |
@jotyy Can you send me the error message you get, so I can see how much RAM it consumes? Because when I set this esmExternals I still have to set an environment variable for NodeJS to allow heap usage up to 4096MB RAM. |
@jotyy I had to downgrade typescript in my case, not update. |
Thanks, my error is also OOM; setting |
I experience this issue too. It almost takes down production server with amount of memory it consumes. 2 ram + 3 swap barely handles it. It happens during lint stage. Previous version I had with normal usage had ts 5.7 internally. Current version uses 5.8. So I assume problem is exactly in ts 5.8 Is there easy way to force it to use 5.7 for linting? |
Solution or workaround const nextConfig: NextConfig = {
typescript: {
ignoreBuildErrors: true,
},
}
|
Link to the code that reproduces this issue
https://github.com/Falling12/loyalty-backend
To Reproduce
Current vs. Expected behavior
Whats happening:
Excepted behavior:
The app should build normally
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
I'm developing this not really large app for a restaurant but recently got this issue where I can't build the app. It can happen that my code is wrong somewhere but I don't really think this. I would be pleased if someone could look into my code aswell. (The build also failed with the same issue when deploying to Vercel)
Thank you for the help in advance!
The text was updated successfully, but these errors were encountered: