Trying to implement the grecaptcha types package (@types/grecaptcha
) in my project. In my tsconfig
, it's configured like this:
"typeRoots": [
"node_modules/@types"
],
However, when attempting to use the provided grecaptcha
object or RecaptchaV2
, I encounter compile errors:
Cannot find namespace 'ReCaptchaV2'
Cannot find name 'grecaptcha'
To make it work, I have to manually add
/// <reference path="../../../../node_modules/@types/grecaptcha/index.d.ts" />
at the beginning of my file. It seems unnecessary based on my setup.
After checking tsc --listFiles
, I confirm that the type files are listed there. Seeking advice on resolving this issue.
Developing an Angular project with angular-cli and using TypeScript 2.4.2 if relevant.