aws-samples / amazon-cloudwatch-alarms-repeated-notification-cdk

MIT No Attribution
10 stars 4 forks source link

Type Errors when running build #2

Open ascheffeapi opened 2 years ago

ascheffeapi commented 2 years ago

I'm getting

npm run build

> repeated_cloud_watch_alarm@1.0.0 build
> tsc

node_modules/@aws-cdk/aws-certificatemanager/lib/certificate.d.ts:2:26 - error TS2307: Cannot find module '@aws-cdk/aws-route53' or its corresponding type declarations.

2 import * as route53 from '@aws-cdk/aws-route53';
                           ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.d.ts:2:26 - error TS2307: Cannot find module '@aws-cdk/aws-route53' or its corresponding type declarations.

2 import * as route53 from '@aws-cdk/aws-route53';
                           ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-cdk/aws-certificatemanager/lib/private-certificate.d.ts:1:25 - error TS2307: Cannot find module '@aws-cdk/aws-acmpca' or its corresponding type declarations.

1 import * as acmpca from '@aws-cdk/aws-acmpca';
                          ~~~~~~~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:41:54 - error TS2315: Type 'IsTuple' is not generic.

41 type IndexProperties<T extends { length: number }> = IsTuple<T> extends true
                                                        ~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:53:6 - error TS2456: Type alias 'IsTuple' circularly references itself.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
        ~~~~~~~

node_modules/@types/prettier/index.d.ts:53:65 - error TS2574: A rest element type must be an array type.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
                                                                   ~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:53:84 - error TS2315: Type 'IsTuple' is not generic.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
                                                                                      ~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:96:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

96     call<
       ~~~~

node_modules/@types/prettier/index.d.ts:131:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

131     each<
        ~~~~

node_modules/@types/prettier/index.d.ts:165:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

165     map<
        ~~~

Found 10 errors.

I needed to add a

"skipLibCheck": true,

to the tsconfig.json to get past it.

dongjaws commented 2 years ago

Hi @ascheffeapi, thanks for your interested in this package. The typescript version is updated to ^4.2.0 for the issue related with "Type 'IsTuple' is not generic". Can you test if this works for you?

Regarding the error related with "Cannot find module '@aws-cdk/aws-route53'", did you change the code to suit your use case? If this is the case, can you check if you have aws-route53 etc added in the dependencies in the package.json?