Hi, I am using the integrating osdk client v2.0.9 to an already existing app that uses Express framework.
my tsconfig module is commonjs.
I can run in dev mode fine using npx tsx src/index.ts. However, I am getting problems building using tsc to generate the dist folder. Example errors are
node_modules/@osdk/api/build/esm/objectSet/ObjectSet.d.ts:44:5 - error TS1128: Declaration or statement expected.
44 readonly fetchPageWithErrors: <L extends PropertyKeys<Q>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default>(args?: FetchPageArgs<Q, L, R, A, S>) => Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions<R, S>, L>>>>;
~~~~~~~~
node_modules/@osdk/api/build/esm/objectSet/ObjectSet.d.ts:44:61 - error TS1005: '?' expected.
44 readonly fetchPageWithErrors: <L extends PropertyKeys<Q>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default>(args?: FetchPageArgs<Q, L, R, A, S>) => Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions<R, S>, L>>>>;
and
node_modules/type-fest/source/sum.d.ts:68:10 - error TS1005: ',' expected.
68 : never
~
node_modules/type-fest/source/sum.d.ts:69:7 - error TS1005: ',' expected.
69 : never) & number
My tsconfig is as follows:
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"resolveJsonModule": true,
"target": "es6",
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": ["node_modules/*"]
}
},
"include": ["src/**/*"]
}
How should the tsconfig look like (I’m quite new to typescript)? Also, do you have an example code for OSDK + Express? The application I am building is purely backend.