You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fails to compile in a TypeScript based project. This issue also includes a temporarily solution.
Actual error
$ npm run build
> [email protected] prebuild
> rm -rf dist/
> [email protected] build
> rm -rf dist && tsc -p .
node_modules/xero-node/dist/gen/model/accounting/models.d.ts:134:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
134 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/appstore/models.d.ts:11:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
11 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/assets/models.d.ts:13:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
13 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/bankfeeds/models.d.ts:13:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
13 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/files/models.d.ts:10:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
10 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/finance/models.d.ts:55:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
55 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/payroll-au/models.d.ts:89:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
89 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/payroll-nz/models.d.ts:100:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
100 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/payroll-uk/models.d.ts:91:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
91 import localVarRequest = require('request');
~~~~~~~~~
node_modules/xero-node/dist/gen/model/projects/models.d.ts:19:34 - error TS7016: Could not find a declaration file for module 'request'. '/home/services/acme/node_modules/request/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
19 import localVarRequest = require('request');
~~~~~~~~~
Found 10 errors in 10 files.
Errors Files
1 node_modules/xero-node/dist/gen/model/accounting/models.d.ts:134
1 node_modules/xero-node/dist/gen/model/appstore/models.d.ts:11
1 node_modules/xero-node/dist/gen/model/assets/models.d.ts:13
1 node_modules/xero-node/dist/gen/model/bankfeeds/models.d.ts:13
1 node_modules/xero-node/dist/gen/model/files/models.d.ts:10
1 node_modules/xero-node/dist/gen/model/finance/models.d.ts:55
1 node_modules/xero-node/dist/gen/model/payroll-au/models.d.ts:89
1 node_modules/xero-node/dist/gen/model/payroll-nz/models.d.ts:100
1 node_modules/xero-node/dist/gen/model/payroll-uk/models.d.ts:91
1 node_modules/xero-node/dist/gen/model/projects/models.d.ts:19
Temporarily solution
If you are encountering issues related to the 'request' module and its types, using declare module 'request'; is a way to tell TypeScript that the module will exist at runtime, and it helps TypeScript understand that the types are available externally. This declaration is often used with third-party libraries or modules that don't have TypeScript typings included.
ignore-types.d.ts. Put this file either in the root directory, or inside a directory you're implicitly including.
SDK Version: 4.37.0
Describe the bug
Fails to compile in a TypeScript based project. This issue also includes a temporarily solution.
Actual error
Temporarily solution
If you are encountering issues related to the 'request' module and its types, using declare module 'request'; is a way to tell TypeScript that the module will exist at runtime, and it helps TypeScript understand that the types are available externally. This declaration is often used with third-party libraries or modules that don't have TypeScript typings included.
ignore-types.d.ts
. Put this file either in the root directory, or inside a directory you're implicitly including.To Reproduce
Code
tsconfig.json
TypeScript version:
Expected behavior
No compilation errors.
The text was updated successfully, but these errors were encountered: