node-gtoken: 4.1.2 breaks our build with " error TS1086: An accessor cannot be declared in an ambient context."
We do not use gtoken directly and this started happening just after 4.1.2 rolled out. It seems to be a very similar issue we reported here for google-gax.
.../node_modules/gtoken/build/src/index.d.ts:32:9 - error TS1086: An accessor cannot be declared in an ambient context.
32 get accessToken(): string | undefined;
~~~~~~~~~~~
.../node_modules/gtoken/build/src/index.d.ts:33:9 - error TS1086: An accessor cannot be declared in an ambient context.
33 get idToken(): string | undefined;
~~~~~~~
.../node_modules/gtoken/build/src/index.d.ts:34:9 - error TS1086: An accessor cannot be declared in an ambient context.
34 get tokenType(): string | undefined;
~~~~~~~~~
.../node_modules/gtoken/build/src/index.d.ts:35:9 - error TS1086: An accessor cannot be declared in an ambient context.
35 get refreshToken(): string | undefined;
~~~~~~~~~~~~
Our environment:
$ node --version
v10.16.2
$ yarn --version
1.17.3
$ tsc --version
Version 3.5.3
Workaround: In package.json add:
"resolutions": {
"gtoken": "4.1.1"
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (6 by maintainers)
It seems that in 4.1.2 you upgraded the typescript compiler to 3.7.0 from 3.6.0 and this generates type definition file that is not working with us who still use earlier versions.
@alexander-fenster just to say that v4.1.3 isn’t available on npm at the moment. Not sure if you intended to do a release yet
Justin ours is 3.5.3. I have added versions in this or the sister google-gax ticket. (Sorry on my mobile right now)
@eng-dibo Since the time it was first reported, all major libraries updated TypeScript version they use, so we are now using
^3.8.3
as well. These errors should go away if you update TypeScript.@iisy-client-releases @BorntraegerMarc 4.1.3 is there now, can you please check?