-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS1086: An accessor cannot be declared in an ambient context #9463
Comments
I had a stab at doing the upgrade but got lost in the package structure 😅 - The end result (after dist files are generated) should make From
To
|
I had the same issue. I resolve it by update the Typescript package to the latest version |
@siropo What version? i'm using angular 8.3.20 and typescript 3.5.3. And i got same error when try to build the project. |
@IsharaMadawa "typescript": "3.7.4" |
@siropo Can you drop the package.json here? |
@IsharaMadawa why? Just try to update your typescript version and check if it is working |
If you're running older version of Angular, e.g. 8.1.0 you'll see the following error
|
yes. i got this error and had to update angular also |
@IsharaMadawa Did you upgrade to angular 9 rc version ? |
This also breaks for us using the latest version of Angular 8.2.x :/ |
I have the 3.7.4 version of Typescript and the 8.3.21 version of Angular and I am getting the same message! Please help! :-) |
Updating with |
Getting this same issue with |
ng update --next @angular/cli --force ;) |
|
Confirmed, upgrading to Angular 9 (and by extension Typescript 3.7.5), this issue is resolved |
Upgrading to TypeScript 3.7.x isn't a great option for library maintainers. This means that the change from 3.6 to 3.7 (technically a breaking change) gets passed down to our consumers and we can't assume they can readily upgrade TypeScript either. @ndelangen I think this can be rectified by changing https://github.com/storybookjs/storybook/blob/next/package.json#L218 to What do you think? |
You got it! |
Should Storybook 6 utilize TypeScript 3.7 since it's going to be offered as a breaking change anyway? If so, I think this should actually get changed in Consequently, if TS 3.7+ is not really important, it could be upgraded as part of Storybook 7 or beyond as well? |
works for me @lychyi. thanks so much for taking care of this & thinking it through!!! 💯 re: 3.7 in storybook 6.0. i'm not sure about whether 3.7 is necessary, will let one of the typescript guys speak to that @ndelangen @kroeder @gaetanmaisse |
FWIW, Also, I just learned that the getter/setter emit is only a breaking change for However, using TS3.7 still hurts Angular folks not able to upgrade to 9.x yet. Angular 8.x is locked at So the main tradeoff I suggested weighing in on is: "Would we be comfortable saying that Storybook 6 is not compatible with Angular 8 so that we could leverage the latest and greatest that TypeScript 3.7 has to offer?" |
@lychyi Great summary. Uninformed gut feel says definitely 3.7 for 6.0. Seize the future!! 😈 |
Getting same issue :) |
@rohittagadiya did you update to latest? |
Try "skipLibCheck": true, inside tsconfig.json eg.
Hope it will help you !! |
Angular updated like is suggested in storybookjs/storybook#9463 (comment)
Works!!!! Thanks |
Works pretty well, Thanks <3 |
Adding "skipLibCheck": true, in the compilerOptions inside file tsconfig.json worked for me. Thank you so much . |
Chiming in - |
Thank you. Working well. |
Thank you <3 |
change version to : Can solve this problem |
|
ng update @angular-devkit/build-angular |
Describe the bug
Upgraded to 5.3.3 just now and our Angular build is failing with the following:
From a quick google, it appears other repos are facing the same issue due to the use of TypeScript 3.7.0 - but Angular is restricted to <3.5.0
Similar errors
nestjs/nest#3513
googleapis/node-gtoken#244
I believe the breaking change come from TypeScript directly microsoft/TypeScript#33939 - but until a fix is released, the
index.d.ts
file will need regenerating withnpm i typescript@~3.6.0
(swap^
for~
)System:
The text was updated successfully, but these errors were encountered: