We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Typescript build warnings in Aspose.PDF Cloud SDK for Node.js

Hello, I’m getting typescript compilation errors from the asposepdfcloud node module. I have got around this by changing the tsconfig.json compiler options. Is there a way to resolve/fix this permanently, so that I don’t have to turn off compiler checks in the options?

See details below:

Module dependency from package.json:

“asposepdfcloud”: “^20.12.0”,

Edited tsconfig.json compiler options:

“noImplicitAny”: false, // Set to false to ignore compiler errors from aspose pdf cloud
“strictNullChecks”: false, // Set to false to ignore compiler errors from aspose pdf cloud

Compiler errors recorded when above options are set to “true”:

node_modules/asposepdfcloud/src/auth.ts:38:5 - error TS7010: ‘handle401response’, which lacks return-type annotation, implicitly has an ‘any’ return type.

38 handle401response(configuration: Configuration);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/asposepdfcloud/src/configuration.ts:60:9 - error TS2322: Type ‘boolean | undefined’ is not assignable to type ‘boolean’.
Type ‘undefined’ is not assignable to type ‘boolean’.

60 this.debugMode = debugMode;
~~~~~~~~~~~~~~

node_modules/asposepdfcloud/src/requestHelper.ts:51:40 - error TS7006: Parameter ‘url’ implicitly has an ‘any’ type.

51 export function addQueryParameterToUrl(url, queryParameters, parameterName, parameterValue) {
~~~

node_modules/asposepdfcloud/src/requestHelper.ts:51:45 - error TS7006: Parameter ‘queryParameters’ implicitly has an ‘any’ type.

51 export function addQueryParameterToUrl(url, queryParameters, parameterName, parameterValue) {
~~~~~~~~~~~~~~~

node_modules/asposepdfcloud/src/requestHelper.ts:51:62 - error TS7006: Parameter ‘parameterName’ implicitly has an ‘any’ type.

51 export function addQueryParameterToUrl(url, queryParameters, parameterName, parameterValue) {
~~~~~~~~~~~~~

node_modules/asposepdfcloud/src/requestHelper.ts:51:77 - error TS7006: Parameter ‘parameterValue’ implicitly has an ‘any’ type.

51 export function addQueryParameterToUrl(url, queryParameters, parameterName, parameterValue) {
~~~~~~~~~~~~~~

node_modules/asposepdfcloud/src/requestHelper.ts:73:48 - error TS7053: Element implicitly has an ‘any’ type because expression of type ‘“uri”’ can’t be used to index type ‘Options’.
Property ‘uri’ does not exist on type ‘Options’.

73 let sa = superagent(requestOptions.method, requestOptions[“uri”]);
~~~~~~~~~~~~~~~~~~~~~

node_modules/asposepdfcloud/src/requestHelper.ts:114:24 - error TS7006: Parameter ‘err’ implicitly has an ‘any’ type.

114 sa.catch(async err => {
~~~

node_modules/asposepdfcloud/src/requestHelper.ts:124:24 - error TS7006: Parameter ‘response’ implicitly has an ‘any’ type.

124 sa.then(async (response) => {
~~~~~~~~

@thebirdmanloves

Thank you very much for pointing out the issue. We will look into the issue(PDFCLOUD-2236) and will fix it in the upcoming future release.

1 Like