# Angular 7 (An accessor cannot be declared in an ambient context)

**URL:** <https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297>\
**Category:** CMS\
**Created:** [November 17, 2020, 7:28am UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297 "2020-11-17T07:28:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rockyawfa](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rockyawfa](https://forum.builder.io/u/rockyawfa)\
**Post date:** [November 17, 2020, 7:28am UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297/1 "2020-11-17T07:28:28Z")

</div>

Hello. I’m quite new to Angular and when

**I try to build --prod my angular apps, I get this errors:**

ERROR in node\_modules/@builder.io/sdk/dist/src/classes/observable.class.d.ts(7,9 ): error TS1086: An accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(301,16): error TS1086: An accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(302,16): error TS1086: An accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(308,16): error TS1086: An accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(322,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(323,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(324,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(328,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(329,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(331,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(332,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(360,17): error TS1086: An accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(367,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(368,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(380,9): error TS1086: A n accessor cannot be declared in an ambient context. node\_modules/@builder.io/sdk/dist/src/builder.class.d.ts(407,9): error TS1086: A n accessor cannot be declared in an ambient context.

**Here is my package.json:**

“dependencies”: {

```
"@agm/core": "1.0.0-beta.2",

"@angular-devkit/build-angular": "^0.13.10",

"@angular-material-extensions/password-strength": "^3.6.1",

"@angular/animations": "7.0.4",

"@angular/cdk": "7.0.4",

"@angular/common": "7.0.4",

"@angular/compiler": "7.0.4",

"@angular/core": "7.0.4",

"@angular/flex-layout": "7.0.0-beta.19",

"@angular/forms": "7.0.4",

"@angular/http": "7.0.4",

"@angular/material": "7.0.4",

"@angular/platform-browser": "7.0.4",

"@angular/platform-browser-dynamic": "7.0.4",

"@angular/router": "7.0.4",

"@builder.io/angular": "^1.1.20",

"@fortawesome/angular-fontawesome": "^0.3.0",

"@fortawesome/fontawesome-svg-core": "^1.2.32",

"@fortawesome/free-brands-svg-icons": "^5.15.1",

"@fortawesome/free-solid-svg-icons": "^5.15.1",

"@ng-bootstrap/ng-bootstrap": "^4.1.1",

"@ngu/carousel": "^1.5.5",

"@ngx-translate/core": "10.0.1",

"@ngx-translate/http-loader": "3.0.1",

"@swimlane/ngx-datatable": "11.1.7",

"@yellowspot/ng-truncate": "^1.5.1",

"angular-calendar": "0.26.4",

"angular-font-awesome": "^3.1.2",

"angular-in-memory-web-api": "0.7.0",

"angular-star-rating": "3.0.8",

"animate.css": "^3.7.2",

"bootstrap": "^4.3.1",

"chart.js": "2.5.0",

"classlist.js": "1.1.20150312",

"core-js": "2.4.1",

"country-state-city": "^1.0.2",

"css-star-rating": "1.2.4",

"date-fns": "1.28.5",

"font-awesome": "^4.7.0",

"gsap": "^3.2.6",

"hammerjs": "2.0.8",

"hopscotch": "0.3.1",

"imports-loader": "^0.8.0",

"jquery": "^3.5.1",

"mdbootstrap": "^4.17.0",

"moment": "^2.25.1",

"ng2-charts": "1.6.0",

"ng2-dragula": "1.3.1",

"ng2-file-upload": "1.2.1",

"ng2-validation": "4.2.0",

"ngx-color-picker": "5.3.8",

"ngx-infinite-scroll": "^7.1.0",

"ngx-owl-carousel-o": "^1.2.0",

"ngx-pagination": "3.1.0",

"ngx-perfect-scrollbar": "6.1.0",

"ngx-quill": "2.0.4",

"parallax-js": "^3.1.0",

"perfect-scrollbar": "1.4.0",

"rxjs": "6.1.0",

"rxjs-compat": "6.1.0",

"scrollmagic": "^2.0.7",

"web-animations-js": "2.3.1",

"zone.js": "0.8.26"

```

},

“devDependencies”: {

```
"@angular-devkit/core": "^7.3.10",

"@angular/cli": "7.0.4",

"@angular/compiler-cli": "^7.2.11",

"@angular/language-service": "7.0.4",

"@angular/material-moment-adapter": "^9.2.4",

"@types/hopscotch": "0.2.28",

"@types/jasmine": "2.5.38",

"@types/node": "6.0.60",

"codelyzer": "~2.0.0",

"copy-webpack-plugin": "4.3.0",

"enhanced-resolve": "3.3.0",

"jasmine-core": "~2.5.2",

"jasmine-spec-reporter": "~3.2.0",

"karma": "~1.4.1",

"karma-chrome-launcher": "~2.1.1",

"karma-cli": "~1.0.1",

"karma-coverage-istanbul-reporter": "~0.2.0",

"karma-jasmine": "~1.1.0",

"karma-jasmine-html-reporter": "~0.2.2",

"node-sass": "^4.13.1",

"protractor": "~5.1.0",

"ts-node": "2.0.0",

"tslint": "4.5.0",

"typescript": "3.1.6"

```

}

---

<div class="post-metadata">

**Author:** ![kara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kara/32/80_2.png) [@kara](https://forum.builder.io/u/kara)\
**Post date:** [December 4, 2020, 7:36pm UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297/2 "2020-12-04T19:36:06Z")

</div>

If you could create a CodeSandbox with some minimal code that reproduces/triggers the problem and send the link to us, that could help us a lot when debugging the error. Thanks!

---

<div class="post-metadata">

**Author:** ![kara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kara/32/80_2.png) [@kara](https://forum.builder.io/u/kara)\
**Post date:** [February 18, 2021, 5:18pm UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297/3 "2021-02-18T17:18:56Z")

</div>

Hi there! Just wanted to follow-up and see if we could still help in any way.

---

<div class="post-metadata">

**Author:** ![Devtechk](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Devtechk](https://forum.builder.io/u/Devtechk)\
**Post date:** [March 1, 2021, 8:39am UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297/4 "2021-03-01T08:39:05Z")

</div>

Hi! i’m Having the same issue with a free account a fresh install of angular:

Angular 8

---

<div class="post-metadata">

**Author:** ![kara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kara/32/80_2.png) [@kara](https://forum.builder.io/u/kara)\
**Post date:** [March 1, 2021, 5:36pm UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297/5 "2021-03-01T17:36:52Z")

</div>

If you could create a CodeSandbox with some minimal code that reproduces/triggers the problem and send the link to us, that could help us a lot when debugging the error. Thanks!

---

<div class="post-metadata">

**Author:** ![cseaman](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@cseaman](https://forum.builder.io/u/cseaman)\
**Post date:** [April 22, 2021, 12:01am UTC](https://forum.builder.io/t/angular-7-an-accessor-cannot-be-declared-in-an-ambient-context/297/6 "2021-04-22T00:01:09Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/1de111f422482112a6f0d6e1f7051e76a94f7e16.png)  
I experienced the same in Angular 8 (still the default for the [ASP.NET](http://ASP.NET) (.NET 5) Angular template, unfortunately). You can add this command to your **tsconfig.json** and it resolves (read: ignores) it.

Or better yet, upgrade to Angular 11 and there are no such errors.
