oracle/oci-typescript-sdk

Typescript compile error on object storage SDK

Closed this issue · 4 comments

Hi, I'm introcuded recently to oracle cloud.
I'm trying to build a little application to prove my object storage management strategy concept. Before writing my own code, I just wanted to try SDK and know how to set credentials on it.
However, when I built the typescript example source file which is in example directory (https://github.com/oracle/oci-typescript-sdk/blob/master/examples/typescript/objectstorage.ts), error comes from node_modules/oci-objectstorage/lib/upload-manager/node-fs-blob.d.ts.

The error message is

node_modules/oci-objectstorage/lib/upload-manager/node-fs-blob.d.ts:8:22 - error TS2420: Class 'NodeFSBlob' incorrectly implements interface 'UploadableBlob'.
  Type 'NodeFSBlob' is missing the following properties from type 'UploadableBlob': arrayBuffer, stream, text

8 export declare class NodeFSBlob implements UploadableBlob {
                       ~~~~~~~~~~


Found 1 error.

Fortunately, objectstorate.ts file is successfully converted to javascript file and I could access object storage using SDK.

Do you mind check the error above out?

my packages.json is

{
  "scripts": {
    "clean": "rm -rf dist",
    "prebuild": "tslint -c tslint.json -p tsconfig.json --fix",
    "build": "yarn clean && tsc",
    "prestart": "yarn build",
    "start": "tsc --watch & nodemon dist/index.js",
    "start-service": "node dist/index.js",
    "test": "jest",
    "pre-commit": "yarn tslint && yarn build",
    "tslint": "tslint --project tsconfig.json",
    "tslint:fix": "tslint --project tsconfig.json --fix"
  },
  "dependencies": {
    "oci-objectstorage": "^1.10.0"
  },
  "devDependencies": {
    "tslint": "^5.20.1",
    "typescript": "^3.6.4"
  }
}

and node version is just the same as you mentioned in readme.md

$ node -v
v10.15.3

Thank you

Hi @moimstone-Crong Can you change typescript version in your package.json to "typescript": "3.6.4" and try again? Our SDK does not support typescript version above 3.6.4. As you are using typescript version ^3.6.4, its probable that you have higher version of typescript.

Oh, I have misunderstood the meaning of ^. After removing ^, I can compile without any errors.

Thanks

fkamp commented

Are there any plans to support Typescript 4.1.3 any time soon?

@fkamp oci-typescript-sdk now supports TypeScript v4.1.3. The current latest version have TypeScript v4.1.3 support. https://www.npmjs.com/package/oci-sdk/v/1.13.0