Home
Support Forums

React isn't included - I didn't notice weeks ago, so it is hard to diagnose

Dear Netlify Community, please help.

My build logs tell my virgin ears that my deployments were failing, with this error that react, react-dom nor babel-core aren’t “installed”. I think it is when I tried using a npm package I made with an incorrect webpack config (libraryTarget), a package json (peerDependencies instead of dependencies as react), & an alias for react from node_modules. I was just trying things out.

I have since cleared netlify build cache & picked out the source code of the package for my projects, which dwindles the build errors (react, react-dom nor babel-core aren’t “installed”) to 6 vulnerabilities (2 low, 4 moderate), & just before building, this: I’ve also never seen Scavenge allocation failure nor /* anonymous /(aka / anonymous */) [0x187d13b02201] [/opt/build/repo/node_modules/webpack-sources/lib/applySourceMap.js:~58] [pc=0x37db40553047](this=0x09f4a6d826f1 ,chunk=0x15c14b356de9 <String[2]: e.>,middleMapping=0x18c44f361301 )
6:53:26 AM: 3: walk(aka SourceNode_walk) [0x3f7…
6:53:26 AM: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

6:47:18 AM: Build ready to start
6:47:20 AM: build-image version: 653805ca4a64301556e56dc4b321ef8fc20cbb7c
6:47:20 AM: build-image tag: v3.8.2
6:47:20 AM: buildbot version: 5ca46ad10ed1b3bf6d683d62872e59029498e5a4
6:47:20 AM: Building without cache
6:47:20 AM: Starting to prepare the repo for build
6:47:20 AM: No cached dependencies found. Cloning fresh repo
6:47:20 AM: git clone https://github.com/NickCarducci/Wavepoint.la
6:47:21 AM: Preparing Git Reference refs/heads/master
6:47:21 AM: Parsing package.json dependencies
6:47:22 AM: Starting build script
6:47:22 AM: Installing dependencies
6:47:22 AM: Python version set to 2.7
6:47:23 AM: Downloading and installing node v10.24.1...
6:47:24 AM: Downloading https://nodejs.org/dist/v10.24.1/node-v10.24.1-linux-x64.tar.xz...
6:47:24 AM: Computing checksum with sha256sum
6:47:24 AM: Checksums matched!
6:47:27 AM: Now using node v10.24.1 (npm v6.14.12)
6:47:27 AM: Started restoring cached build plugins
6:47:27 AM: Finished restoring cached build plugins
6:47:27 AM: Attempting ruby version 2.6.2, read from environment
6:47:29 AM: Using ruby version 2.6.2
6:47:29 AM: Using PHP version 5.6
6:47:29 AM: Started restoring cached node modules
6:47:29 AM: Finished restoring cached node modules
6:47:29 AM: Installing NPM modules using NPM version 6.14.12
6:47:39 AM: npm WARN deprecated tooltip.js@1.3.3: Tooltip.js is not supported anymore, please migrate to tippy.js
6:47:39 AM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
6:47:43 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
6:47:44 AM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
6:47:47 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
6:47:49 AM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
6:47:52 AM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
6:47:53 AM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
6:47:53 AM: npm WARN deprecated rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
6:47:54 AM: npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
6:47:55 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
6:47:56 AM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
6:47:56 AM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
6:47:56 AM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
6:47:56 AM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
6:47:57 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
6:47:58 AM: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
6:48:04 AM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
6:48:42 AM: > leveldown@5.6.0 install /opt/build/repo/node_modules/leveldown
6:48:42 AM: > node-gyp-build
6:48:42 AM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
6:48:42 AM: > node -e "try{require('./postinstall')}catch(e){}"
6:48:42 AM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js
6:48:42 AM: > node -e "try{require('./postinstall')}catch(e){}"
6:48:42 AM: > core-js-pure@3.15.2 postinstall /opt/build/repo/node_modules/core-js-pure
6:48:43 AM: > node -e "try{require('./postinstall')}catch(e){}"
6:48:43 AM: > ejs@2.7.4 postinstall /opt/build/repo/node_modules/ejs
6:48:43 AM: > node ./postinstall.js
6:48:43 AM: > core-js@3.15.2 postinstall /opt/build/repo/node_modules/formiojs/node_modules/core-js
6:48:43 AM: > node -e "try{require('./postinstall')}catch(e){}"
6:48:43 AM: > protobufjs@6.11.2 postinstall /opt/build/repo/node_modules/protobufjs
6:48:43 AM: > node scripts/postinstall
6:48:43 AM: > geofirestore@4.4.2 postinstall /opt/build/repo/node_modules/geofirestore
6:48:43 AM: > node postinstall.js
6:48:44 AM: WARNING: geofirestore v4.4.2 is incompatiable with versions of this library prior to v4.0.0.
6:48:44 AM: Visit https://github.com/MichaelSolati/geofirestore-js#upgrading for more information about how to upgrade your collections.
6:48:44 AM: > styled-components@4.4.1 postinstall /opt/build/repo/node_modules/styled-components
6:48:44 AM: > node ./scripts/postinstall.js || exit 0
6:48:44 AM: Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
6:48:46 AM: npm notice created a lockfile as package-lock.json. You should commit this file.
6:48:46 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.3 (node_modules/react-scripts/node_modules/fsevents):
...
**6:48:46 AM: npm WARN notsup Unsupported engine for get-stdin@9.0.0: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})**
**6:48:46 AM: npm WARN notsup Not compatible with your version of node/npm: get-stdin@9.0.0**
**6:48:46 AM: npm WARN notsup Unsupported engine for meow@10.1.0: wanted: {"node":">=12.17"} (current: {"node":"10.24.1","npm":"6.14.12"})**
**6:48:46 AM: npm WARN notsup Not compatible with your version of node/npm: meow@10.1.0**
**...**
**6:48:46 AM: npm WARN coloreact@0.3.1 requires a peer of react@^15.6.1 || ^16.0.0 but none is installed. You must install peer dependencies yourself.**
**6:48:46 AM: npm WARN react-add-to-calendar@0.1.5 requires a peer of react@^15.5.4 || ^16.0.0 but none is installed. You must install peer dependencies yourself.**
**6:48:46 AM: npm WARN react-add-to-calendar@0.1.5 requires a peer of react-dom@^15.5.4 || ^16.0.0 but none is installed. You must install peer dependencies yourself.**
**...**
**6:48:46 AM: npm WARN react-input-slider@5.1.7 requires a peer of react-dom@^16.8.4 but none is installed. You must install peer dependencies yourself.**
**...**
**6:48:46 AM: npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.14.5 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.**
**6:48:46 AM: npm WARN react-svg-inline@2.1.1 requires a peer of react@^0.14.9 || ^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.**
6:48:46 AM: npm WARN 4vosh@1.0.0 No repository field.
6:48:46 AM: added 2327 packages from 1247 contributors and audited 2380 packages in 75.785s
6:48:48 AM: 197 packages are looking for funding
6:48:48 AM:   run `npm fund` for details
6:48:48 AM: found 6 vulnerabilities (2 low, 4 moderate)
6:48:48 AM:   run `npm audit fix` to fix them, or `npm audit` for details
6:48:48 AM: NPM modules installed
6:48:48 AM: Started restoring cached go cache
6:48:48 AM: Finished restoring cached go cache
6:48:48 AM: Installing Go version 1.12
6:48:53 AM: unset GOOS;
6:48:53 AM: unset GOARCH;
6:48:53 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
6:48:53 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
6:48:53 AM: go version >&2;
6:48:53 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
6:48:53 AM: go version go1.12 linux/amd64
6:48:53 AM: Installing missing commands
6:48:53 AM: Verify run directory
6:48:54 AM: ​
6:48:54 AM: ────────────────────────────────────────────────────────────────
6:48:54 AM:   Netlify Build                                                 
6:48:54 AM: ────────────────────────────────────────────────────────────────
6:48:54 AM: ​
6:48:54 AM: ❯ Version
6:48:54 AM:   @netlify/build 16.2.1
6:48:54 AM: ​
6:48:54 AM: ❯ Flags
6:48:54 AM:   deployId: 60fe92a666b0b30ba5cab34f
6:48:54 AM: ​
6:48:54 AM: ❯ Current directory
6:48:54 AM:   /opt/build/repo
6:48:54 AM: ​
6:48:54 AM: ❯ Config file
6:48:54 AM:   No config file was defined: using default values.
6:48:54 AM: ​
6:48:54 AM: ❯ Context
6:48:54 AM:   production
6:48:54 AM: ​
6:48:54 AM: ────────────────────────────────────────────────────────────────
6:48:54 AM:   1. Build command from Netlify app                             
6:48:54 AM: ────────────────────────────────────────────────────────────────
6:48:54 AM: ​
6:48:54 AM: $ CI= npm run build
6:48:55 AM: > 4vosh@1.0.0 build /opt/build/repo
6:48:55 AM: > react-scripts build
6:48:57 AM: Creating an optimized production build...
6:53:26 AM: <--- Last few GCs --->
6:53:26 AM: [1621:0x3e37fb0]   269366 ms: Scavenge 1347.5 (1420.5) -> 1347.1 (1421.0) MB, 5.6 / 0.0 ms  (average mu = 0.206, current mu = 0.159) allocation failure
6:53:26 AM: [1621:0x3e37fb0]   269374 ms: Scavenge 1347.8 (1421.0) -> 1347.2 (1422.0) MB, 4.6 / 0.0 ms  (average mu = 0.206, current mu = 0.159) allocation failure
6:53:26 AM: [1621:0x3e37fb0]   269405 ms: Scavenge 1347.9 (1422.0) -> 1347.3 (1422.5) MB, 26.8 / 0.0 ms  (average mu = 0.206, current mu = 0.159) allocation failure
6:53:26 AM: <--- JS stacktrace --->
6:53:26 AM: ==== JS stack trace =========================================
6:53:26 AM:     0: ExitFrame [pc: 0x37db3e45bf1d]
6:53:26 AM:     1: StubFrame [pc: 0x37db3e420673]
6:53:26 AM: Security context: 0x25ab8b21e6c1 <JSObject>
6:53:26 AM:     2: /* anonymous */(aka /* anonymous */) [0x187d13b02201] [/opt/build/repo/node_modules/webpack-sources/lib/applySourceMap.js:~58] [pc=0x37db40553047](this=0x09f4a6d826f1 <undefined>,chunk=0x15c14b356de9 <String[2]: e.>,middleMapping=0x18c44f361301 <Object map = 0x33aee098c759>)
6:53:26 AM:     3: walk(aka SourceNode_walk) [0x3f7...
6:53:26 AM: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
6:53:26 AM:  1: 0x8fb090 node::Abort() [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  2: 0x8fb0dc  [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  3: 0xb0336e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  4: 0xb035a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  5: 0xef7602  [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  6: 0xef7708 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  7: 0xf037e2 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  8: 0xf04114 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM:  9: 0xf06d81 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 10: 0xecf065  [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 11: 0xed68da v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 12: 0x102034d v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 13: 0xb00d14 v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 14: 0x10213be v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 15: 0x119a068 v8::internal::Runtime_HasProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/opt/buildhome/.nvm/versions/node/v10.24.1/bin/node]
6:53:26 AM: 16: 0x37db3e45bf1d
6:53:26 AM: npm ERR! code ELIFECYCLE
6:53:26 AM: npm ERR! errno 1
6:53:26 AM: npm ERR! 4vosh@1.0.0 build: `react-scripts build`
6:53:26 AM: npm ERR! Exit status 1
6:53:26 AM: npm ERR!
6:53:26 AM: npm ERR! Failed at the 4vosh@1.0.0 build script.
6:53:26 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
6:53:26 AM: npm ERR! A complete log of this run can be found in:
6:53:26 AM: npm ERR!     /opt/buildhome/.npm/_logs/2021-07-26T10_53_26_628Z-debug.log
6:53:26 AM: ​
6:53:26 AM: ────────────────────────────────────────────────────────────────
6:53:26 AM:   "build.command" failed                                        
6:53:26 AM: ────────────────────────────────────────────────────────────────
6:53:26 AM: ​
6:53:26 AM:   Error message
6:53:26 AM:   Command failed with exit code 1: CI= npm run build
6:53:26 AM: ​
6:53:26 AM:   Error location
6:53:26 AM:   In Build command from Netlify app:
6:53:26 AM:   CI= npm run build
6:53:26 AM: ​
6:53:26 AM:   Resolved config
6:53:26 AM:   build:
6:53:26 AM:     command: CI= npm run build
6:53:26 AM:     commandOrigin: ui
6:53:26 AM:     environment:
6:53:26 AM:       - GOOGQ4YI3ZSBM4OKTZVY3JJA
6:53:26 AM:       - NPM_FLAGS
6:53:26 AM:       - REACT_APP_MAPBOX_TOKEN
6:53:26 AM:     publish: /opt/build/repo/build
6:53:26 AM:     publishOrigin: ui
6:53:27 AM: Caching artifacts
6:53:27 AM: Started saving node modules
6:53:27 AM: Finished saving node modules
6:53:27 AM: Started saving build plugins
6:53:27 AM: Finished saving build plugins
6:53:27 AM: Started saving pip cache
6:53:27 AM: Finished saving pip cache
6:53:27 AM: Started saving emacs cask dependencies
6:53:27 AM: Finished saving emacs cask dependencies
6:53:27 AM: Started saving maven dependencies
6:53:27 AM: Finished saving maven dependencies
6:53:27 AM: Started saving boot dependencies
6:53:27 AM: Finished saving boot dependencies
6:53:27 AM: Started saving rust rustup cache
6:53:27 AM: Finished saving rust rustup cache
6:53:27 AM: Started saving go dependencies
6:53:29 AM: Finished saving go dependencies
6:53:33 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:53:33 AM: Creating deploy upload records
6:53:33 AM: Failing build: Failed to build site
6:53:33 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
6:53:33 AM: Finished processing build request in 6m13.203629301s

Thanks and good morning

This Support Guide covers the topic of memory usage

Your build is likely not efficient. You could try building locally and deploying using Netlify CLI, or figure out why your build requires so much memory.

1 Like

That is likely an XY artifact of the errors printed higher in the log. I’m trying to figure the reason thru the logs; I know the memory usage is caused by the former errors like introducing THEN REMOVING a npm module that might have an incorrect webpack config (libraryTarget), a package json (peerDependencies instead of dependencies as react), & an alias for react from node_modules can corrupt the build (if nothing else can be gleaned from these logs: react, react-dom nor babel-core aren’t “installed”). Thanks. This is a create-react-app

I had to force netlify environment variable NODE_VERSION:14.17.3
(1) Please notify email for failures #features, would be very useful even though this issue was with node versioning. (2) When will Netlify make LTS the default instead of -v4? Thanks!!!