question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

4.1.2 breaks our build with " error TS1086: An accessor cannot be declared in an ambient context."

See original GitHub issue

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"
  }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
gae123commented, Nov 14, 2019

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.

4reactions
BorntraegerMarccommented, Nov 18, 2019

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS1086: An accessor cannot be declared in ambient context
This is first time for me when i have problem like this inside angular with typescript Errors looks like this: ERROR in ../../node_modules/@ ......
Read more >
Angular 7 (An accessor cannot be declared in an ambient ...
I try to build --prod my angular apps, I get this errors: ... error TS1086: A n accessor cannot be declared in an...
Read more >
An accessor cannot be declared in an ambient context. after ...
Hi there, i am trying to upgrade the babylon version to try the new stuff. However after update i am flooded with errors...
Read more >
error TS1086: An accessor cannot be declared in an ambient ...
d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@angular/cdk/a11y/focus-trap ...
Read more >
Angular build errors - Material Design for Bootstrap
p>When trying to build or serve my angular application, the console outputs the ... error TS1086: An accessor cannot be declared in an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found