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

SAP CAP deployment fails, points to a .ts file instead of a .js one #5442

Open
altermanm opened this issue Feb 5, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@altermanm
Copy link

Describe the Bug

We followed SCIM API documentation to deploy an app: https://api.sap.com/api/PlatformAPI/overview

The command used:

npx openapi-generator --input resources/service-specs --outputDir src/generated --skipValidation --transpile

Image

In cat-service.js we added const { SCIMUsersShadowUsersApi } = require("../src/generated/PlatformAPI/scim-users-shadow-users-api");

But this file points to the .ts and deployment fails due to not finding this module.

We also tried explicitly mentioning the .js at the end of the file but it keeps navigating to the .ts and deployment still fails:

const { SCIMUsersShadowUsersApi } = require("../src/generated/PlatformAPI/scim-users-shadow-users-api.js");

Steps to Reproduce

npx openapi-generator --input resources/service-specs --outputDir src/generated --skipValidation --transpile

Expected Behavior

Expecting to point to a .js file, but .ts file is sought and thus module-not-found problem.

Screenshots

Image

Used Versions

  • Node version via node -v: v20.18.1
  • NPM version via `npm -v: 10.8.2
  • SAP Cloud SDK version: sap/cds-dk [8.6.1]
  • For CAP users, CAP version: sap/generator-cap-project [1.8.2]

Code Examples

No response

Log File

No response

Affected Development Phase

Development

Impact

Blocked

Timeline

Days.

Additional Context

No response

@altermanm altermanm added the bug Something isn't working label Feb 5, 2025
@tomfrenken
Copy link
Member

tomfrenken commented Feb 11, 2025

Hi @altermanm, the cause is likely wrong / missing dependencies.

You need @types/node and @sap-cloud-sdk/openapi in addition to @sap-cloud-sdk/openapi-generator for transpilation to work.

You can find more information in our documentation, especially the note explaining transpilation.

The version you listed for the SAP Cloud SDK SAP Cloud SDK version: sap/cds-dk [8.6.1] is not actually the SAP Cloud SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants