-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Reached heap limit when building since v4.2 #13638
Comments
I forced [email protected] using yarn's selective dependency resolution but that didn't fix it either. @patak-dev Do you have more experience with this? |
Update: Just to be clear, the out-of-memory issue is because my CI environment does not have much memory. The question is why Vite 4.2.0 uses much more memory than before. Did some more tests and ran the heap profiler with and without
I'm not sure why, but I'm getting different results when building without sourcemaps on 4.3.9. Either the graph looks exactly as if I'm building with sourcemaps (3,300 MB), but sometimes it lowers to 2,500 MB. (Edit: I've run the build command many times now, and now it's always 3,300 MB like the screenshot above. Maybe some unexpected optimization happened that caused it to drop for a while?) Either way, I guess something has changed related to sourcemaps, as the results with are nearly identical. |
@bluwy Found the issue finally. This commit broke the CLI option |
Thanks for figuring this out @dd-jonas (and sorry for the breakage). Didn't expect this to happen and feels like a weird behaviour from cac, it wants us to support Would you like to send a PR fixing this? The changes should be here: vite/packages/vite/src/node/cli.ts Lines 73 to 91 in 92e5c5d
Handling the You can also workaround this for now but setting the config at |
Describe the bug
Update: Looks like the sourcemap CLI option broke, no performance issue. See comments below.
Reopening this as it is still not solved. I don't know how to create a reproduction without sharing my whole codebase because I don't know what causes this. I'm open for suggestions though.
See comments below, looks like a performance issue introduced in 4.2.0.
I noticed since upgrading to 4.2 that my builds are failing on CI (self hosted runner for GH Actions, 4GB RAM). I'm running
vite build --mode testing --sourcemap false
with a React project. Since I'm not building source maps, I think it's unusual to reach the heap limit so easily, although I'm no expert on this. The build transforms 13702 modules, most of which are from @mui/icons-material. Even when removing this dependency which lowers the module count to around 3000, I still reach the heap limit. On 4.1.5 I don't have any issues with the exact same codebase.Has there been any change since 4.1 that could have impacted this? I did notice a bump from rollup 3.10 to 3.20, but can't tell from the changelog what the impact is. Locally it builds just fine.
I haven't found anything in #2433 that helps me.
Last tested on 4.3.9
Reproduction
Not sure how to repro this without sharing my code
Steps to reproduce
vite build --mode testing --sourcemap false
on the CI server.System Info
Used Package Manager
yarn
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: