ng2-tree icon indicating copy to clipboard operation
ng2-tree copied to clipboard

ERROR: 'TreeModule' does not appear to be an NgModule class.

Open MuneebChaudhry-dev opened this issue 1 year ago • 0 comments

When I imported the 'TreeModule' and include it in imports It display this following error 'TreeModule' does not appear to be an NgModule class. This likely means that the library (ng2-tree) which declares TreeModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

I have tried different solutions like in tsconfig I made following changes:

  • "importHelpers": true,

  • "enableIvy": false, // in angularCompilerOptions

  • I have also cleared the cache of Angular and npm

  • I have also deleted and reinstall node_modules

These solutions didn't worked for me.Please help me to find out the problem and recommend a suitable solution.

I have following dependencies and devDependencies:

 "dependencies": {
    "@angular/animations": "^14.1.0",
    "@angular/common": "^14.1.0",
    "@angular/compiler": "^14.1.0",
    "@angular/core": "^14.1.0",
    "@angular/forms": "^14.1.0",
    "@angular/platform-browser": "^14.1.0",
    "@angular/platform-browser-dynamic": "^14.1.0",
    "@angular/router": "^14.1.0",
    "@syncfusion/ej2-angular-navigations": "^20.3.57",
    "directory-tree": "^3.4.0",
    "ng2-tree": "^2.0.0-rc.11",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "underscore": "^1.13.6",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.1.0",
    "@angular/cli": "~14.1.0",
    "@angular/compiler-cli": "^14.1.0",
    "@types/jasmine": "~4.0.0",
    "electron": "^21.2.3",
    "jasmine-core": "~4.2.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~4.7.2"
  },

MuneebChaudhry-dev avatar Nov 24 '22 06:11 MuneebChaudhry-dev