FG
๐Ÿ’ป Software๐ŸŒ Web & Full-Stack

vite build error: out of memory

Freshabout 2 months ago
Mar 14, 20260 views
Confidence Score74%
74%

Problem

NOTE - PLEASE READ This issue has affected a number of people. Please do not comment with comments along the lines of "I'm also hitting this", but add a thumbs up to the issue instead. We know this is an important issue and "me too" comments will only drown out the comments from people attempting to resolve this issue and will be hidden. Please note however that Vite is a community driven project and a fix may need to come from the community For tips on working around the issue, please see https://rollupjs.org/guide/en/#error-javascript-heap-out-of-memory Describe the bug vite build error: out of memory. Reproduction https://github.com/Axeldeblen/realworld-big-build Possible improvements Reduce magic string memory usage when building source maps: https://github.com/Rich-Harris/magic-string/pull/161#issuecomment-607480189 Logs (Optional if provided reproduction) <--- JS stacktrace ---> ==== JS stack trace ========================================= 0: ExitFrame [pc: 00007FF69790ABBD] Security context: 0x01e6a86408d1 1: decode(aka decode) [000002AD02F874D1] [E:\vite-template\node_modules_rollup@2.40.0@rollup\dist\shared\rollup.js:~133] pc=0000039464A55451 2: decodedSourcemap(aka decodedSourcemap) [000002AD02F8A979] [E:\vite-template\node_modules_rollup@2.40.0@rollup\dist\shared\roll... FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 00007FF696CD180F napi_wrap+119407 2: 00007FF696C787E6 v8::internal::OrderedH

Error Output

error: out of memory.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
74% confidence100% success rate6 verificationsLast verified Mar 14, 2026

Solution: vite build error: out of memory

Low Risk

Update It worked when I allocated a whopping 16GB of RAM for Vite's initialization cycle. As a temporary workaround, you can use the following commands. If it still fails, just increase the size. Temporary workaround a. Using command line arguments ~~~ node --max_old_space_size=16384 ./node_modules/vite/bin/vite.js ~~~ b. Using environment variables ~~~ export NODE_OPTIONS=--max-old-space-s

74

Trust Score

6 verifications

100% success
  1. 1

    Update It worked when I allocated a whopping 16GB of RAM for Vite's initializati

    Update It worked when I allocated a whopping 16GB of RAM for Vite's initialization cycle.

  2. 2

    As a temporary workaround, you can use the following commands. If it still fails

    As a temporary workaround, you can use the following commands. If it still fails, just increase the size.

  3. 3

    a. Using command line arguments

    a. Using command line arguments

  4. 4

    Step 4

    node --max_old_space_size=16384 ./node_modules/vite/bin/vite.js ~~~

Validation

Resolved in vitejs/vite GitHub issue #2433. Community reactions: 29 upvotes.

Verification Summary

Worked: 6
Partial: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

vitebuild-tooljavascripthelp-wantedhas-workaroundp4-importantperformance