相关文章推荐
很酷的钢笔  ·  GitHub - ...·  2 月前    · 
朝气蓬勃的豆腐  ·  安装Genymotion ...·  3 月前    · 

Hello Everyone

I am using typescript with CAP

After upgrading to new version, I start getting following error

Could not find a declaration file for module '@sap/cds'. '/project/node_modules/@sap/cds/lib/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/sap__cds` if it exists or add a new declaration (.d.ts) file containing `declare module '@sap/cds';`ts(7016)

for statement

import cds from "@sap/cds";
Version details
@cap -js/asyncapi: 1.0.1
@cap -js/cds-typer: 0.24.0
@cap -js/openapi: 1.0.4
@cap -js/sqlite: 1.7.1
@Sap /cds: 8.0.3
@Sap /cds-compiler: 5.0.6
@Sap /cds-dk: 8.0.2
@Sap /cds-dk (global): 8.0.2
@Sap /cds-fiori: 1.2.7
@Sap /cds-foss: 5.0.1
@Sap /cds-hana: 2.0.0
@Sap /cds-mtxs: 2.0.2
@Sap /cds-odata-v2-adapter-proxy: 1.9.21
@Sap /eslint-plugin-cds: 3.0.4
Node.js: v20.13.1
Also getting error Cannot find name **** (2304) for SELECt,DELETE,UPDATE statements
Kindly let me know how to fix it

tscomfig.json

{
"compilerOptions" : {
"target" : "ES2022" ,
"module" : "NodeNext" ,
"esModuleInterop" : true ,
"forceConsistentCasingInFileNames" : true ,
"strict" : true ,
"noImplicitAny" : true ,
"strictNullChecks" : true ,
"skipLibCheck" : true ,
"checkJs" : true ,
"outDir" : "./gen/srv" ,
"rootDir" : "./" ,
"rootDirs" : [ "src" , "tests" ],
"baseUrl" : "./" ,
"noErrorTruncation" : true ,
"moduleResolution" : "nodenext" ,
"typeRoots" : [ "./src" ],
"paths" : {
"#cds-models/*" : [ "./@cds-models/*/index.ts" ]
}
},
"include" : [ "srv" ],
"exclude" : [ "node_modules" ]
}

How to 'properly' type an ENUM for CodeCompletion - JS based UI5 app (JSDoc + TS, no d.ts files) in Technology Q&A Surviving and Thriving with the SAP Cloud Application Programming Model: Local development hurdles in Technology Blogs by SAP How to Read a gSheet into Your SAPUI5/Fiori App in 7 Minutes in Technology Blogs by Members