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'.
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:15:13 - 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:10:13 - error TS2532: Object is possibly 'undefined'.
10 searchRequest.image.content = converter.encode(searchRequest.image.content)
Found 8 error(s).
When I skip NullChecks in my tsconfig.json it works. But it should not be needed for this library.