Cannot Build Mattermost Web App

Summary

Cannot Build mattermost-web-app

Steps to reproduce

I’m using latest verison from master 5.21.0

Expected behavior

make build should succeed and dist folder creation

Observed behavior

<— JS stacktrace —>

==== JS stack trace =========================================

0: ExitFrame [pc: 0x13de0d9]
1: StubFrame [pc: 0x144cb01]

Security context: 0x236281f40921
2: _(aka _) [0x2352d287f6e1] [/root/team-collab-web-app/node_modules/terser/dist/bundle.min.js:1] [bytecode=0x160f379dde41 offset=254](this=0x135b950004b9 ,0x135b95003fc1 <String[#4]: name>,0x340b86f75521 <String[9]: FILE_HOST>,0x135b950004b9 )
3: L [0x2352d287f839] [/root/team-collab-web-app/node_mod…

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20200327.101417.3971.0.001.json
Node.js report completed
1: 0xa10730 node::Abort() [node]
2: 0xa10b75 node::OnFatalError(char const*, char const*) [node]
3: 0xb859ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb85d49 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xd34255 [node]
6: 0xd348e6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xd43159 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xd43f95 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xd46a6c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xd0d644 v8::internal::factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x105a93e v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x13de0d9 [node]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mattermost-webapp@0.0.1 build: cross-env NODE_ENV=production webpack --display-error-details --verbose
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mattermost-webapp@0.0.1 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! /root/.npm/_logs/2020-03-27T10_14_18_572Z-debug.log
Makefile:68: recipe for target ‘build’ failed
make: *** [build] Error 1

Is this the guide you followed: https://developers.mattermost.com/contribute/webapp/developer-setup/?

An option is that you could post about this on our Developers channel on our community server, and one of our developers will probably be able to help.

Yes, It is the same guide I followed.
I found out the problem was my server memory was only 1GB so I upgraded the memory and that problem is fixed.