1

I have been using the package @material-extended/mde for implementing the popover with dynamic html content. But somehow I am getting error

error TS1086: An accessor cannot be declared in an ambient context.

Now I have serched the issue over here that it's happening because the versioning with Typescript. I have tried upgrading @angular/cli, typescript, @angular/animations but that din't work for me. My package.json is as follow :

{
  "name": "demo",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.2.8",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "~8.2.8",
    "@angular/compiler": "~8.2.8",
    "@angular/core": "~8.2.8",
    "@angular/forms": "~8.2.8",
    "@angular/http": "^7.2.15",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "~8.2.8",
    "@angular/platform-browser-dynamic": "~8.2.8",
    "@angular/router": "~8.2.8",
    "@material-extended/mde": "^3.0.0",
    "@ng-bootstrap/ng-bootstrap": "^5.3.0",
    "@ngrx/effects": "^8.3.0",
    "@ngrx/store": "^8.3.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "angular-highcharts": "^8.0.3",
    "bootstrap": "^3.3.7",
    "core-js": "^2.5.4",
    "highcharts": "^7.1.3",
    "html2canvas": "^1.0.0-rc.5",
    "jquery": "^3.4.1",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.27",
    "ng-click-outside": "^5.1.1",
    "ng-multiselect-dropdown": "^0.2.5",
    "ng2-completer": "^3.0.3",
    "ng2-select": "^2.0.0",
    "ng2-tooltip-directive": "^2.8.17",
    "ngx-popover": "0.0.16",
    "ngx-print": "^1.2.0-beta.3",
    "rxjs": "~6.5.3",
    "screenfull": "^5.0.0",
    "socket.io-client": "^2.3.0",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.6",
    "@angular/cli": "~8.3.6",
    "@angular/compiler-cli": "~8.2.8",
    "@angular/language-service": "~8.2.8",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ngx-tslint-report": "^1.0.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.5.3"
  }
}

Is there anything that I can do here to solve the issue ?

The Hungry Dictator
  • 3,444
  • 5
  • 37
  • 53
  • similiar https://stackoverflow.com/questions/60092642/ts1086-an-accessor-cannot-be-declared-in-ambient-context – Praveen Soni Mar 05 '20 at 08:10
  • @PraveenSoni I saw ach and every possible options but it is not working – The Hungry Dictator Mar 05 '20 at 09:03
  • Same problem, using same version of typescript. I'm guessing this is a typescript compatibility issue with mde-popover. In the example from the github, typescript 3.1.1 is used – spencer Mar 19 '20 at 15:44
  • If you're using angular material, just use this, the end result is about the same and it only uses native angular material components https://stackblitz.com/edit/angular2-material-popover?file=main.ts – spencer Mar 19 '20 at 15:53

1 Answers1

0

add to typesctipt config to skip typescript file chk.

"compilerOptions": {
    "skipLibCheck": true
}