Error TS1086: An accessor cannot be declared in an ambient context in Angular

Dung Do Tien Aug 28 2021 199

I have a project with Angular 7 and it still works very well for me. But today I build and run it I got an error Error TS1086: An accessor cannot be declared in an ambient context.

ERROR in node_modules/@coreui/angular/lib/sidebar/app-sidebar-nav/app-sidebar-nav-items.component.d.ts(11,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@coreui/angular/lib/sidebar/app-sidebar-nav/app-sidebar-nav-items.component.d.ts(12,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@coreui/angular/lib/sidebar/app-sidebar-nav/app-sidebar-nav-link.component.d.ts(15,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@coreui/angular/lib/sidebar/app-sidebar-nav/app-sidebar-nav-link.component.d.ts(16,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@coreui/angular/lib/sidebar/app-sidebar.component.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@coreui/angular/lib/sidebar/app-sidebar.component.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/ng2-ckeditor/ckbutton.directive.d.ts(1,23): error TS2688: Cannot find type definition file for 'ckeditor'.
node_modules/ng2-ckeditor/ckbutton.directive.d.ts(14,25): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(1,23): error TS2688: Cannot find type definition file for 'ckeditor'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(12,13): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(15,26): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(16,32): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(17,25): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(18,24): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(19,25): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(20,30): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(21,37): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(22,38): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(23,25): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(24,24): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(29,15): error TS2503: Cannot find namespace 'CKEDITOR'.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(36,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(37,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/ng2-ckeditor/ckeditor.component.d.ts(58,26): error TS2503: Cannot find namespace 'CKEDITOR'.

This is my environment

Angular CLI: 7.3.9
Node: 14.17.5
OS: win32 x64
Angular: 7.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.8
@angular-devkit/build-optimizer   0.13.8
@angular-devkit/build-webpack     0.13.8
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cdk                      7.3.3
@angular/cli                      7.3.9
@angular/material                 7.3.3
@ngtools/webpack                  7.3.8
@schematics/angular               7.3.9
@schematics/update                0.13.9
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.0

I tried many ways but it still does not work for me.

Thanks for any suggestions.

Have 1 answer(s) found.
  • B

    Behrad Nafar Aug 28 2021

    Hi buddy, I got same the error and I tried many ways but it can't solve for me.

    And I have to upgrade the Angular version from 7 to 11 and it solved for me.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close