Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error ERR_INVALID_ARG_TYPE in xsuaa-to-ams tutorial while doing cds build --production #118

Open
GaneshGangatharan opened this issue Oct 15, 2024 · 4 comments
Assignees

Comments

@GaneshGangatharan
Copy link

INCIDENT-MANAGEMENT % cds build --production
building project [/Users/MyUser/Documents/GitHub-Tool/INCIDENT-MANAGEMENT], clean [true]
cds-dk [8.3.0], cds [8.3.1], compiler [5.3.2], home [/Users/MyUser/Documents/GitHub-Tool/INCIDENT-MANAGEMENT/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: 'ams', src: 'srv', 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/AdminService.Addresses.hdbview
gen/db/src/gen/AdminService.Customers.hdbview
gen/db/src/gen/AdminService.Incidents.hdbview
gen/db/src/gen/AdminService.Incidents_conversation.hdbview
gen/db/src/gen/AdminService.Status.hdbview
gen/db/src/gen/AdminService.Status_texts.hdbview
gen/db/src/gen/AdminService.Urgency.hdbview
gen/db/src/gen/AdminService.Urgency_texts.hdbview
gen/db/src/gen/DRAFT.DraftAdministrativeData.hdbtable
gen/db/src/gen/ProcessorService.Addresses.hdbview
gen/db/src/gen/ProcessorService.Customers.hdbview
gen/db/src/gen/ProcessorService.DraftAdministrativeData.hdbview
gen/db/src/gen/ProcessorService.Incidents.hdbview
gen/db/src/gen/ProcessorService.Incidents_conversation.hdbview
gen/db/src/gen/ProcessorService.Incidents_conversation_drafts.hdbtable
gen/db/src/gen/ProcessorService.Incidents_drafts.hdbtable
gen/db/src/gen/ProcessorService.Status.hdbview
gen/db/src/gen/ProcessorService.Status_texts.hdbview
gen/db/src/gen/ProcessorService.Urgency.hdbview
gen/db/src/gen/ProcessorService.Urgency_texts.hdbview
gen/db/src/gen/data/sap.capire.incidents-Addresses.csv
gen/db/src/gen/data/sap.capire.incidents-Addresses.hdbtabledata
gen/db/src/gen/data/sap.capire.incidents-Customers.csv
gen/db/src/gen/data/sap.capire.incidents-Customers.hdbtabledata
gen/db/src/gen/data/sap.capire.incidents-Incidents.conversation.csv
gen/db/src/gen/data/sap.capire.incidents-Incidents.conversation.hdbtabledata
... 32 more. Run with DEBUG=build to show all files.

TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received undefined
at Object.resolve (node:path:1129:7)
at Object.to (/usr/local/lib/node_modules/@sap/cds-dk/lib/build/plugin.js:136:37)
at Object.compileCds (/Users/MyUser/Documents/GitHub-Tool/INCIDENT-MANAGEMENT/node_modules/@sap/ams-dev/src/cap/capAmsFlow.js:27:30)
at async AmsBuildPlugin.build (/Users/MyUser/Documents/GitHub-Tool/INCIDENT-MANAGEMENT/node_modules/@sap/ams-dev/src/cap/AmsBuildPlugin.js:39:3)
at async Promise.allSettled (index 0)
at async BuildTaskEngine._executePipeline (/usr/local/lib/node_modules/@sap/cds-dk/lib/build/buildTaskEngine.js:159:29)
at async BuildTaskEngine._executeBuildTasks (/usr/local/lib/node_modules/@sap/cds-dk/lib/build/buildTaskEngine.js:150:25)
at async BuildTaskEngine.processTasks (/usr/local/lib/node_modules/@sap/cds-dk/lib/build/buildTaskEngine.js:59:33)
at async build (/usr/local/lib/node_modules/@sap/cds-dk/lib/build/index.js:19:16)
at async Object.build (/usr/local/lib/node_modules/@sap/cds-dk/bin/build.js:171:5) {
code: 'ERR_INVALID_ARG_TYPE'
}

@singhabhi1999
Copy link
Contributor

Hi @GaneshGangatharan ,

can you please share with me the application latest codebase. I need to check the application configurations.

Regards,
Abhinav

@miyasuta
Copy link

miyasuta commented Nov 3, 2024

@singhabhi1999
I am experiencing the same issue. My repository URL is below (branch: ams).
https://github.com/miyasuta/incident-management-2411

@miyasuta
Copy link

miyasuta commented Dec 1, 2024

@singhabhi1999
Could you please confirm whether the position of AMS_DCL_ROOT in mta.yaml below is correct?

- name: incident-management-srv
  type: nodejs
  path: gen/srv
  requires:
  - name: incident-management-db
  - name: incident-management-auth
    parameters:
      config:
         credential-type: "X509_GENERATED"
  properties:
    AMS_DCL_ROOT: ams/dcl

@miyasuta
Copy link

miyasuta commented Jan 5, 2025

@singhabhi1999
I have updated the versions of @sap/ams and @sap/ams-dev to 2.0.0. However, the build error still persists.

...
   gen/srv/srv/csn.json
   gen/srv/srv/odata/v4/AdminService.xml
   gen/srv/srv/odata/v4/ProcessorService.xml

[ERROR] Unexpected error during CDS to DCL compilation: The "path" argument must be of type string. Received undefined

CDS build failed
[2025-01-06 05:30:22] ERROR the "before-all"" build failed: could not execute the "npx cds build --production" command: exit status 1
make: *** [Makefile_20250106053015.mta:28: pre_build] Error 1
[2025-01-06 05:30:22] ERROR could not build the MTA project: could not execute the "make -f Makefile_20250106053015.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_20250106053015.mta p=cf mtar= strict=true mode=" command: exit status 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants