TS1086: An accessor cannot be declared in an ambient context
See original GitHub issueDescribe the bug Upgraded to 5.3.3 just now and our Angular build is failing with the following:
[ng]
[ng] ERROR in ../../node_modules/@storybook/channels/dist/index.d.ts:25:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng]
[ng] 25 get hasTransport(): boolean;
[ng] ~~~~~~~~~~~~
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 ❤️.5.0
Similar errors https://github.com/nestjs/nest/issues/3513 https://github.com/googleapis/node-gtoken/issues/244
I believe the breaking change come from TypeScript directly https://github.com/microsoft/TypeScript/issues/33939 - but until a fix is released, the index.d.ts
file will need regenerating with npm i typescript@~3.6.0
(swap ^
for ~
)
System:
OS: macOS Mojave 10.14.6
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 12.14.1 - /usr/local/bin/node
npm: 6.13.4 - /usr/local/bin/npm
Browsers:
Chrome: 79.0.3945.117
Safari: 13.0.4
npmPackages:
@storybook/addon-actions: ^5.3.3 => 5.3.3
@storybook/addon-knobs: ^5.3.3 => 5.3.3
@storybook/addon-links: ^5.3.3 => 5.3.3
@storybook/addon-notes: ^5.3.3 => 5.3.3
@storybook/addon-storyshots: ^5.3.3 => 5.3.3
@storybook/addons: ^5.3.3 => 5.3.3
@storybook/angular: ^5.3.3 => 5.3.3
@storybook/cli: ^5.3.3 => 5.3.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:22
- Comments:55 (22 by maintainers)
Top Results From Across the Web
TS1086: An accessor cannot be declared in ambient context
- error TS1086: An accessor cannot be declared in an ambient context. [...] Does somebody know a reason? I can't test my app...
Read more >Angular 7 (An accessor cannot be declared in an ambient ...
node_modules/@builder.io/sdk/dist/src/builder.class.d.ts(301,16): error TS1086: An accessor cannot be declared in an ambient context.
Read more >Fixing accessor cannot be declared in an ambient context error
ERROR in node_modules/@angular/animations/browser/browser.d.ts:135:9 - error TS1086: An accessor cannot be declared in an ambient context.h.
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 >An accessor cannot be declared in an ambient context
Hi, I'm creating an app with language selection and when I try to run it it gives me the following error. Can someone...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try "skipLibCheck": true, inside tsconfig.json eg.
Hope it will help you !!
ng update --next @angular/cli --force npm install typescript@latest
😉