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
Typescript failed to compile because of missing interfaces.
Adding typescript lib (dom/webworker), in tsconfig file, fix the problem but I compile it in a BE so How can I compile my service with pdjs without adding "dom" or "webworker" to typescript lib?
Compilation error output:
`node_modules/@pagerduty/pdjs/build/src/api.d.ts:29:38 - error TS2304: Cannot find name 'Response'.
This has come up a few times on various projects but there doesn't seem to be a general consensus on the best approach yet - some informative links on this issue on AWS SDK: aws/aws-sdk-js-v3#3063
Essentially, the quick workarounds are what you've mentioned above (adding dom) or adding skipLibCheck: true. The Microsoft thread is much more in-depth and currently still open: microsoft/TypeScript#31894
Typescript failed to compile because of missing interfaces.
Adding typescript lib (dom/webworker), in tsconfig file, fix the problem but I compile it in a BE so How can I compile my service with pdjs without adding "dom" or "webworker" to typescript lib?
Compilation error output:
`node_modules/@pagerduty/pdjs/build/src/api.d.ts:29:38 - error TS2304: Cannot find name 'Response'.
29 export interface APIResponse extends Response {
~~~~~~~~
node_modules/@pagerduty/pdjs/build/src/api.d.ts:32:15 - error TS2304: Cannot find name 'Response'.
32 response: Response;
~~~~~~~~
node_modules/@pagerduty/pdjs/build/src/common.d.ts:2:41 - error TS2304: Cannot find name 'RequestInit'.
2 export interface RequestOptions extends RequestInit {
~~~~~~~~~~~
node_modules/@pagerduty/pdjs/build/src/common.d.ts:10:47 - error TS2304: Cannot find name 'URL'.
10 export declare function request(url: string | URL, options?: RequestOptions): Promise;
~~~
node_modules/@pagerduty/pdjs/build/src/common.d.ts:10:87 - error TS2304: Cannot find name 'Response'.
10 export declare function request(url: string | URL, options?: RequestOptions): Promise;
~~~~~~~~
node_modules/@pagerduty/pdjs/build/src/events.d.ts:4:40 - error TS2304: Cannot find name 'Response'.
4 export interface EventResponse extends Response {
~~~~~~~~
node_modules/@pagerduty/pdjs/build/src/events.d.ts:6:15 - error TS2304: Cannot find name 'Response'.
6 response: Response;
~~~~~~~~
Found 7 errors in 3 files.
Errors Files
2 node_modules/@pagerduty/pdjs/build/src/api.d.ts:29
3 node_modules/@pagerduty/pdjs/build/src/common.d.ts:2
2 node_modules/@pagerduty/pdjs/build/src/events.d.ts:4`
tsconfig:
The text was updated successfully, but these errors were encountered: