NPM build fails with heap size issue

Video SDK Type and Version
@zoom/videosdk”: “^1.4.0”

React js

On importing the videosdk npm build fails

import ZoomVideo from "@zoom/videosdk";


Creating an optimized production build...
         <--- Last few GCs --->
         [5448:03B2AF30]   187840 ms: Mark-sweep (reduce) 1020.0 (1028.1) -> 1019.6 (1028.6) MB, 1527.3 / 0.0 ms  (average mu = 0.141, current mu = 0.005) allocation failure scavenge might not succeed
         [5448:03B2AF30]   189706 ms: Mark-sweep (reduce) 1020.8 (1028.8) -> 1020.7 (1029.6) MB, 1858.1 / 0.0 ms  (average mu = 0.076, current mu = 0.004) allocation failure scavenge might not succeed
         <--- JS stacktrace --->
     6>EXEC : FATAL error : MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory [D:\j3\workspace\Innovia_Dev\InnoviaClient\InnoviaClient.csproj]
         npm ERR! code ELIFECYCLE
         npm ERR! errno 134
         npm ERR! InnoviaWeb@0.1.0 build: `react-scripts build`
         npm ERR! Exit status 134
         npm ERR! 
         npm ERR! Failed at the InnoviaWeb@0.1.0 build script.
         npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
         npm ERR! A complete log of this run can be found in:
         npm ERR!     C:\Windows\system32\config\systemprofile\AppData\Roaming\npm-cache\_logs\2022-08-04T10_21_28_108Z-debug.log

How To Reproduce
Steps to reproduce the behavior including:
1. Install latest zoom video sdk version
*2. import in a component/page
*3. npm run build

I tried removing the sdk and runing the build command it worked but as soon as i add the import statement for zoom video sddk build fails

Anyone facing this issue?

Thank You

1 Like

Hi @gourishmesta1993 , try either of these suggestions:

Let us know if it helps and any other troubleshooting efforts you try.



tried both the solutions still same error.

Even tried adding --max_old_space_size=5120

Thank You

Hi @gourishmesta1993 , this error is generic and requires quite a bit of troubleshooting to find the right fix for your configuration.

I’ve seen some suggestions about modifying your package.json: node.js - How to fix "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" error - Stack Overflow

This is for AWS, but could still be helpful: 'JavaScript heap out of memory' when adding a dependency on the SDK to a small react-native app · Issue #1877 · aws/aws-sdk-js · GitHub

Because this issue is not specific to our video SDK, I recommend continuing to use various developer resources like the ones I’ve shared to fix.

Please update us when you resolve :slight_smile:

1 Like

Hi @gianni.zoom

Issue is no more occurring now. :innocent:

First i executed the below command

set NODE_OPTIONS=--max_old_space_size=7168

Then i added the below code
"start": "react-scripts --max_old_space_size=7168 start",
"build": "react-scripts --max_old_space_size=7168 build",

this fixed the issue and right the build is getting created .

Thank You


@gourishmesta1993 ,

Nice I’m so happy it’s been resolved and thank you for sharing exactly what you did!

1 Like