Posts

Showing posts with the label Definitelytyped

Angular 7 & Stripe Error TS2304: Cannot Find Name 'Stripe'

Answer : The issue is resolved by including a reference to the @types/stripe-v3 package in the compilerOptions.types array of your tsconfig.app.json file in the src directory of your Angular project. { "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "types": [ "stripe-v3" ] }, "exclude": [ "test.ts", "**/*.spec.ts" ] } This solution was posted by bjornharvold in this thread. Angular imports types based on values of compilerOptions.types and compilerOptions.typeRoots from the typescript configuration file. TS compilerOptions docs reference By default Angular projects created using angular cli will have two typescript configuration files. tsconfig.json in the root of the project tsconfig.app.json in /src directory If both types and typeRoots are undefined angular will import all the typings from...