TS1086: An accessor cannot be declared in an ambient context. after upgrade to 4.1.0-beta.22

Hi there,

i am trying to upgrade the babylon version to try the new stuff. However after update i am flooded with errors like:

error TS1086: An accessor cannot be declared in an ambient context.
get renderTargetsEnabled(): boolean;

These errors are related to this typescript issue. Looks like you upgraded typescript to 3.7.X. I would upgrade typescript as well, but currently my app is Angular 8 and it doesn’t support anything higher than 3.5.X.

Any suggestions?

This is the problem with TS. They keep breaking compat…

Unfortunately I do not see a good way to help you

2 Likes

Yea, it causes lot of problems for other library creators too, but you could either:

  • downlevel typescript to 3.6.X
  • use this tool to downlevel *.d.ts to be backwards compatible

I don’t know if any of that is feasible for you. Angular 9 is behind the doors with support for new typescript, so i’ll expect to upgrade to it in short time.

I managed to upgrade typescript to 3.7.X in my project even when it is not officially supported :slight_smile: everything seems to work fine

1 Like

I am still facing this with reaact and nodejs backend in a project from here . Kind of Stuck here , Could anyone help me ?

I don’t see other solution than upgrading typescript. How exactly are you stuck? Can’t you upgrade typescript?