Error en yarn build:prod

39 views
Skip to first unread message

Emilia Lobo

unread,
May 3, 2024, 11:59:14 AMMay 3
to DSpace Developers
Hello.
Could you help me with this error?

yarn build:prod
yarn run v1.22.19
$ cross-env NODE_ENV=production yarn run build:ssr
$ ng build --configuration production && ng run dspace-angular:server:production
⠸ Generating browser application bundles (phase: building)...
<--- Last few GCs --->

[25586:0x623cbf0]    54121 ms: Mark-sweep 904.7 (933.6) -> 895.0 (932.0) MB, 1049.6 / 0.0 ms  (average mu = 0.208, current mu = 0.101) allocation failure scavenge might not succeed
[25586:0x623cbf0]    55356 ms: Mark-sweep 905.6 (934.8) -> 896.6 (933.5) MB, 1058.8 / 0.0 ms  (average mu = 0.176, current mu = 0.143) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb090e0 node::Abort() [ng build --configuration production]
 2: 0xa1b70e  [ng build --configuration production]
 3: 0xce1a20 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --configuration production]
 4: 0xce1dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --configuration production]
 5: 0xe99435  [ng build --configuration production]
 6: 0xe99f16  [ng build --configuration production]
 7: 0xea843e  [ng build --configuration production]
 8: 0xea8e80 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --configuration production]
 9: 0xeabdfe v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build --configuration production]
10: 0xe6d33a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng build --configuration production]
11: 0x11e61e6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng build --configuration production]
12: 0x15d9e59  [ng build --configuration production]
Aborted
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Mohamed Azzam

unread,
May 6, 2024, 7:36:56 AMMay 6
to DSpace Developers

Hi, I encountered the same error, which seems to be related to memory issues:

I found a workaround by using this command: NODE_OPTIONS="--max-old-space-size=5096" yarn start

If this doesn't resolve the issue for you, you may need to adjust the memory allocation for Ubuntu to 3500.

Emilia Lobo

unread,
May 6, 2024, 1:55:03 PMMay 6
to DSpace Developers
Thanks for your response but, I keep getting the same error with that command.
I'm trying to build dspace-angular on the production server:


NODE_OPTIONS=--max-old-space-size=4096 yarn start:prod
yarn run v1.22.19
$ yarn run build:prod && cross-env NODE_ENV=production yarn run serve:ssr


$ cross-env NODE_ENV=production yarn run build:ssr
$ ng build --configuration production && ng run dspace-angular:server:production

⠦ Generating browser application bundles (phase: building)...Killed
error Command failed with exit code 137.


info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

error Command failed with exit code 137.


info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

error Command failed with exit code 137.


info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

DSpace Developers

unread,
May 10, 2024, 11:17:42 AMMay 10
to DSpace Developers
Hi,

An "exit code 137" from Yarn means that Yarn (or Node.js) ran out of memory.  My only recommendation may be to try a higher value for the "--max-old-space-size" option.  On my end, in Windows 11, I don't even specify that option because the defaults for Node.js v18 work fine for me.   However, our automated tests which run on Ubuntu, use "--max-old-space-size=4096" as that approach works best for them.

So, I'd recommend first trying the build *without* the "max-old-space-size" option to see if that helps.  If that doesn't work, try *increasing* "max-old-space-size" to greater than 4GB (4096).  Maybe try 5GB (5120) or larger?

See also the discussion in this ticket.  As best we can tell, Node.js may have different memory defaults on different operating systems.  We've yet to find a single value of "max-old-space-size" that is best everywhere.  https://github.com/DSpace/dspace-angular/issues/2259

Tim

Emilia Lobo

unread,
May 10, 2024, 2:38:14 PMMay 10
to DSpace Developers
Thank you all very much for your response.
This was solved by increasing the space size to 8GB
Emilia.-

Reply all
Reply to author
Forward
0 new messages