Error on Build - Frontend stage
2020-07-23T16:01:42.011Z [INFO]: yarn run v1.16.0
2020-07-23T16:01:42.040Z [INFO]: $ react-scripts build
2020-07-23T16:01:44.013Z [INFO]: Creating an optimized production build...
2020-07-23T16:03:52.274Z [INFO]: <--- Last few GCs --->
[1166:0x29219c0] 126188 ms: Mark-sweep 1361.2 (1424.1) -> 1360.3 (1424.1) MB, 2104.0 / 0.0 ms (average mu = 0.109, current mu = 0.001) allocation failure scavenge might not succeed
[1166:0x29219c0] 128164 ms: Mark-sweep 1361.5 (1424.6) -> 1360.5 (1424.6) MB, 1972.9 / 0.0 ms (average mu = 0.058, current mu = 0.002) allocation failure scavenge might not succeed
2020-07-23T16:03:52.277Z [INFO]: <--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x60ffb45be1d]
1: StubFrame [pc: 0x60ffb45d3a6]
2: StubFrame [pc: 0x60ffb4868d5]
Security context: 0x28960021e6e9
3: SourceMapGenerator_serializeMappings [0xbab2ba9e8b1] [/codebuild/output/src118782697/src/Amlupdate-V2/node_modules/@babel/generator/node_modules/source-map/lib/source-map-generator.js:337] [bytecode=0x3a7a67362b31 offset=195](this=0x05ad58f02201
1: 0x8f9d10 node::Abort() [/root/.nvm/versions/node/v10.16.0/bin/node]
2: 0x8f9d5c [/root/.nvm/versions/node/v10.16.0/bin/node]
3: 0xaffd0e v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/root/.nvm/versions/node/v10.16.0/bin/node]
Have you tried this?: https://github.com/aws-amplify/amplify-cli/issues/3708
finally this worked

This does not work for me with the same problem
Most helpful comment
finally this worked
