@sap-cloud-sdk/generator: Cannot find name 'ElectronicDocProtocolCodeStrEnum'.
See original GitHub issueI try to generate a custom SAP Cloud SDK OData based on the Metadata from the SAP Business One Service Layer. My sample project is provided here: sap-business-one-odata-cap branch real-b1-metadata.
Steps to reproduce the behavior:
- Clone the above repository
- run
npm i
- run
npm run generate-odata-client
- After about 10 minutes you get this error:
[2021-07-13T05:54:10.674Z] ERROR (generator-cli): ErrorWithCause: Generation of services failed.
at new ErrorWithCause (/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/node_modules/@sap-cloud-sdk/util/dist/error-with-cause.js:32:16)
at /Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/node_modules/@sap-cloud-sdk/generator/dist/generator-cli.js:33:18
Caused by:
Error: Compilation Errors:
/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/srv/odata-client/sapb-1-service/ElectronicDocumentsRequestBuilder.ts:3:502 - error TS2304: Cannot find name 'ElectronicDocProtocolCodeStrEnum'.
/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/srv/odata-client/sapb-1-service/ElectronicDocumentsRequestBuilder.ts:3:502 - error TS4073: Parameter 'code' of public method from exported class has or is using private name 'ElectronicDocProtocolCodeStrEnum'.
/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/srv/odata-client/sapb-1-service/ElectronicDocumentsRequestBuilder.ts:3:2072 - error TS2304: Cannot find name 'ElectronicDocProtocolCodeStrEnum'.
/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/srv/odata-client/sapb-1-service/ElectronicDocumentsRequestBuilder.ts:3:2072 - error TS4073: Parameter 'code' of public method from exported class has or is using private name 'ElectronicDocProtocolCodeStrEnum'.
/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/srv/odata-client/sapb-1-service/ElectronicDocumentsRequestBuilder.ts:3:502 - error TS4073: Parameter 'code' of public method from exported class has or is using private name 'ElectronicDocProtocolCodeStrEnum'.
/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/srv/odata-client/sapb-1-service/ElectronicDocumentsRequestBuilder.ts:3:2072 - error TS4073: Parameter 'code' of public method from exported class has or is using private name 'ElectronicDocProtocolCodeStrEnum'.
at Object.<anonymous> (/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/node_modules/@sap-cloud-sdk/generator-common/dist/compiler.js:69:31)
at step (/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/node_modules/@sap-cloud-sdk/generator-common/dist/compiler.js:33:23)
at Object.next (/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/node_modules/@sap-cloud-sdk/generator-common/dist/compiler.js:14:53)
at fulfilled (/Users/gwolf/Documents/Projects/cap/sap-business-one-odata-cap/node_modules/@sap-cloud-sdk/generator-common/dist/compiler.js:5:58)
Is this an issue with the @sap-cloud-sdk/generator or should we file an incident via SAP Support for SAP Business One as their Metadata may be incorrect?
Best regards Gregor
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
TypeScript getting error TS2304: cannot find name ' require'
I am getting the error "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page. I have...
Read more >Cannot find name 'DedicatedGatewayRequestOptions' #22003
I am trying to use @azure/cosmos inside an Azure Function written in typescript. When I try to npm run build , the build...
Read more >Typescript Angular Cannot find name [closed]
I am working on Aspnet Core Angular project and getting following error: TS2304: Cannot find name 'email'. The code is executed in visual...
Read more >TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >NodeJS SDK: While using Localhost mode, error generated
NodeJS SDK: While using Localhost mode, error generated: Cannot find name 'path' · Issue. Using Node.js SDK, when trying to run the code...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @gregorwolf ,
thanks for the heads-up.
The root cause is that this metadata file is use
enum
as a key of some entities, which is not supported in the SDK. I’ll create a backlog item for it.As you mentioned, this is a sample app, I would mark it as medium priority.
Best regards, Junjie
@gregorwolf ,
the fix has been merged and is available if you try the
canary
version. We’ll release a stable version hopefully in this week.I’ll close this ticket, please reopen if you have questions.
Best regards, Junjie