regulaforensics / FaceSDK-web-js-client

Regula Face SDK web API js client for the browser and node.js based on axios
https://regulaforensics.com
5 stars 3 forks source link

Breaking in compile time #56

Closed ankita-p17 closed 11 months ago

ankita-p17 commented 1 year ago

I'm using @regulaforensics/facesdk-webclient module in the nestJS application. Recently I faced a compile-time issue in my dependency.

Version used - "@regulaforensics/facesdk-webclient": "^5.1.1",

Command - npm run build Expected - It should be successfully executed Actual - node_modules/@regulaforensics/facesdk-webclient/src/ext/person-api.ts:14:13 - error TS2532: Object is possibly 'undefined'.

14 if (imageFields.image.content && typeof imageFields.image.content !== "string") {

node_modules/@regulaforensics/facesdk-webclient/src/ext/person-api.ts:14:49 - error TS2532: Object is possibly 'undefined'.

14         if (imageFields.image.content && typeof imageFields.image.content !== "string") {

node_modules/@regulaforensics/facesdk-webclient/src/ext/person-api.ts:15:13 - error TS2532: Object is possibly 'undefined'.

15 imageFields.image.content = converter.encode(imageFields.image.content)

node_modules/@regulaforensics/facesdk-webclient/src/ext/person-api.ts:15:58 - error TS2532: Object is possibly 'undefined'.

15             imageFields.image.content = converter.encode(imageFields.image.content)

node_modules/@regulaforensics/facesdk-webclient/src/ext/search-api.ts:9:13 - error TS2532: Object is possibly 'undefined'.

9 if (searchRequest.image.content && typeof searchRequest.image.content !== "string") {

node_modules/@regulaforensics/facesdk-webclient/src/ext/search-api.ts:9:51 - error TS2532: Object is possibly 'undefined'.

9         if (searchRequest.image.content && typeof searchRequest.image.content !== "string") {

node_modules/@regulaforensics/facesdk-webclient/src/ext/search-api.ts:10:13 - error TS2532: Object is possibly 'undefined'.

10 searchRequest.image.content = converter.encode(searchRequest.image.content)

node_modules/@regulaforensics/facesdk-webclient/src/ext/search-api.ts:10:60 - error TS2532: Object is possibly 'undefined'.

10             searchRequest.image.content = converter.encode(searchRequest.image.content)

Found 8 error(s).

Screenshot 2023-06-14 at 6 32 58 PM

When I skip NullChecks in my tsconfig.json it works. But it should not be needed for this library.

SergeyIlchenko commented 11 months ago

We have fixed these bugs in the latest version 5.2.6 Please use the latest version of the package