Skip to content

Error: Command failed: npx tsc --outDir "/home/user/projects/btp-cap-genai-rag/gen/srv/" #48

@mgnxbsskmh-oss

Description

@mgnxbsskmh-oss

After cloning the repository in Business Application Studio, applying the solutions #44, #45, #46, #47, and then running npm run build:mbt in project's root folder, I get the following error

genai-mail-insights@1.0.0 build:mbt
mbt build

[2026-01-26 22:06:53] INFO Cloud MTA Build Tool version 1.2.34
[2026-01-26 22:06:53] INFO generating the "Makefile_20260126220653.mta" file...
[2026-01-26 22:06:53] INFO done
[2026-01-26 22:06:53] INFO executing the "make -f Makefile_20260126220653.mta p=cf mtar= strict=true mode=" command...
[2026-01-26 22:06:53] INFO validating the MTA project
[2026-01-26 22:06:53] INFO running the "before-all" build...
[2026-01-26 22:06:53] INFO executing the "npm run build" command...

genai-mail-insights@1.0.0 build
npm run build:cds && npm run build:ui && npm run build:ts

genai-mail-insights@1.0.0 build:cds
cds-ts build --profile production

building project [/home/user/projects/btp-cap-genai-rag], clean [true]
cds-dk [8.7.1], cds [8.7.1], compiler [6.6.2], home [/home/user/projects/btp-cap-genai-rag/node_modules/@sap/cds]

{
build: {
target: 'gen',
tasks: [
{ for: 'hana', src: 'db', options: { model: ['db', 'srv', 'app'] }},
{ for: 'nodejs', src: 'srv', options: { model: ['db', 'srv', 'app'] }},
{ for: 'typescript', src: '.', options: { model: ['db', 'srv', 'app', '.'] }}
]
}
}

..................................................done > wrote output to:
gen/db/package.json
gen/db/src/.hdiconfig
gen/db/src/gen/.hdiconfig
gen/db/src/gen/.hdinamespace
gen/db/src/gen/MailInsightsService.Mails.hdbview
gen/db/src/gen/MailInsightsService.Translations.hdbview
gen/db/src/gen/ai.db.Mails.hdbtable
gen/db/src/gen/ai.db.Translations.hdbtable
gen/db/undeploy.json
gen/srv/.cdsrc.json
gen/srv/eslint.config.js
gen/srv/package-lock.json
gen/srv/package.json
gen/srv/srv/_i18n/i18n.json
gen/srv/srv/constants.ts
gen/srv/srv/csn.json
gen/srv/srv/mail-insights-service.ts
gen/srv/srv/odata/v4/MailInsightsService.xml
gen/srv/srv/schemas.ts
gen/srv/srv/types.ts
gen/srv/srv/utils/ai-core.ts

Error: Command failed: npx tsc --outDir "/home/user/projects/btp-cap-genai-rag/gen/srv/"

<--- Last few GCs --->

[9855:0x25a85000] 48753 ms: Scavenge 2030.2 (2080.4) -> 2022.5 (2080.4) MB, pooled: 0 MB, 1.29 / 0.00 ms (average mu = 0.513, current mu = 0.496) allocation failure;
[9855:0x25a85000] 48758 ms: Scavenge 2030.2 (2080.4) -> 2022.4 (2096.4) MB, pooled: 0 MB, 2.07 / 0.00 ms (average mu = 0.513, current mu = 0.496) allocation failure;

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0xe3811e node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
2: 0x125fb70 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
3: 0x125fe47 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
4: 0x148d885 [node]
5: 0x14a70f9 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
6: 0x147b7c8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
7: 0x147c6f5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
8: 0x14553ce v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
9: 0x18b69cc v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
10: 0x7fa49e66c476
Aborted (core dumped)

at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:414:12)
at ChildProcess.emit (node:events:524:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1101:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {

code: 134,
killed: false,
signal: null,
cmd: 'npx tsc --outDir "/home/user/projects/btp-cap-genai-rag/gen/srv/"',
stdout: '',
stderr: '\n' +
'<--- Last few GCs --->\n' +
'\n' +
'[9855:0x25a85000] 48753 ms: Scavenge 2030.2 (2080.4) -> 2022.5 (2080.4) MB, pooled: 0 MB, 1.29 / 0.00 ms (average mu = 0.513, current mu = 0.496) allocation failure; \n' +
'[9855:0x25a85000] 48758 ms: Scavenge 2030.2 (2080.4) -> 2022.4 (2096.4) MB, pooled: 0 MB, 2.07 / 0.00 ms (average mu = 0.513, current mu = 0.496) allocation failure; \n' +
'\n' +
'\n' +
'<--- JS stacktrace --->\n' +
'\n' +
'FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory\n' +
'----- Native stack trace -----\n' +
'\n' +
' 1: 0xe3811e node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]\n' +
' 2: 0x125fb70 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]\n' +
' 3: 0x125fe47 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]\n' +
' 4: 0x148d885 [node]\n' +
' 5: 0x14a70f9 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]\n' +
' 6: 0x147b7c8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n' +
' 7: 0x147c6f5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n' +
' 8: 0x14553ce v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]\n' +
' 9: 0x18b69cc v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]\n' +
'10: 0x7fa49e66c476 \n' +
'Aborted (core dumped)\n',
messages: []
}
[2026-01-26 22:07:43] ERROR the "before-all"" build failed: could not execute the "npm run build" command: exit status 1
make: *** [Makefile_20260126220653.mta:28: pre_build] Error 1
[2026-01-26 22:07:43] ERROR could not build the MTA project: could not execute the "make -f Makefile_20260126220653.mta p=cf mtar= strict=true mode=" command: exit status 2
Error: could not build the MTA project: could not execute the "make -f Makefile_20260126220653.mta p=cf mtar= strict=true mode=" command: exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions