I have written my backend using spring boot and mongo DB as database and front end using REACT JS.
Both backend and database are working but when I try to deploy my front end with all the required environment variables it shows below error in deployed logs.
Git hub repo link for frontend : https://github.com/heni2021/Social-Media-Frontend
Error in Railway Debug console:
[email protected] start
react-scripts start
(node:36) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use node --trace-deprecation ... to show where the warning was created)
(node:36) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...
<--- Last few GCs --->
[36:0x3a2a8a0] 16311 ms: Scavenge 247.7 (257.9) -> 247.4 (258.4) MB, 1.9 / 0.0 ms (average mu = 0.186, current mu = 0.030) allocation failure;
[36:0x3a2a8a0] 16485 ms: Mark-sweep 248.5 (258.6) -> 246.3 (258.6) MB, 166.4 / 0.0 ms (average mu = 0.278, current mu = 0.388) allocation failure; scavenge might not succeed
[36:0x3a2a8a0] 16843 ms: Mark-sweep 247.5 (258.6) -> 246.3 (258.4) MB, 349.8 / 0.0 ms (average mu = 0.138, current mu = 0.021) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xab4728 node::Abort() [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
2: 0x9a4839 [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
3: 0xcc23e0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
4: 0xcc27ab v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
5: 0xea6cc5 [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
6: 0xea6d9b [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
7: 0xeba18a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*, v8::GCCallbackFlags) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
8: 0xebafa5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
9: 0xe9789a v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
10: 0xe98c44 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
11: 0xe7934d v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
12: 0x12616eb v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
13: 0x16abdf9 [/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2/bin/node]
I tried every single thing like npm install etc... but it is not working.
How to deploy it!