manishjanky / ngx-select-dropdown

Custom Dropdown for Angular 4+ with multiple and single selection options
MIT License
116 stars 82 forks source link

[BUG] Angular9 compile error #230

Closed altro3 closed 3 years ago

altro3 commented 3 years ago

Bug description

When trying to build a project, an error occurs.

Expected result

The project should be built without errors.

Actual result

Compiling ngx-select-dropdown : module as esm5
Error: Error on worker #7: Error: Failed to compile entry-point ngx-select-dropdown (module as esm5) due to compilation errors:
node_modules/@angular/common/common.d.ts:115:22 - error NG6002: Appears in the NgModule.imports of SelectDropDownModule, but could not be resolved to an NgModule class

115 export declare class CommonModule {
                         ~~~~~~~~~~~~
node_modules/@angular/forms/forms.d.ts:2699:22 - error NG6002: Appears in the NgModule.imports of SelectDropDownModule, but could not be resolved to an NgModule class

2699 export declare class FormsModule {
                          ~~~~~~~~~~~

    at ClusterWorker.compile (D:\Work\front\admin-panel\node_modules\@angular\compiler-cli\ngcc\src\main.js:177:27)
    at Worker.<anonymous> (D:\Work\front\admin-panel\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\worker.js:44:42)
    at Worker.emit (node:events:369:20)
    at process.<anonymous> (node:internal/cluster/worker:33:12)
    at process.emit (node:events:369:20)
    at emit (node:internal/child_process:920:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at ClusterMaster.onWorkerMessage (D:\Work\front\admin-panel\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:158:27)
    at D:\Work\front\admin-panel\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:46:95
    at ClusterMaster.<anonymous> (D:\Work\front\admin-panel\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:238:57)
    at step (D:\Work\front\admin-panel\node_modules\tslib\tslib.js:141:27)
    at Object.next (D:\Work\front\admin-panel\node_modules\tslib\tslib.js:122:57)
    at D:\Work\front\admin-panel\node_modules\tslib\tslib.js:115:75
    at new Promise (<anonymous>)
    at Object.__awaiter (D:\Work\front\admin-panel\node_modules\tslib\tslib.js:111:16)
    at EventEmitter.<anonymous> (D:\Work\front\admin-panel\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:232:32)
    at EventEmitter.emit (node:events:369:20)

Steps to reproduce

1. 2. 3.

Context

Your Environment

Windows 10 Version 20H2 NodeJS 15.12.0 npm: 7.7.0

package json:

{
  "name": "admin-panel",
  "version": "1.0.0",
  "scripts": {
    "build": "ng build --prod --baseHref=/panel/",
    "builddev": "ng build --baseHref=/panel/",
    "lint": "ng lint",
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "9.0.0",
    "@angular/common": "9.0.0",
    "@angular/compiler": "9.0.0",
    "@angular/core": "9.0.0",
    "@angular/forms": "9.0.0",
    "@angular/platform-browser": "9.0.0",
    "@angular/platform-browser-dynamic": "9.0.0",
    "@angular/router": "9.0.0",
    "@ngx-translate/core": "12.1.1",
    "@ngx-translate/http-loader": "4.0.0",
    "@swimlane/ngx-datatable": "^17.0.0",
    "@types/crypto-js": "^3.1.43",
    "https-proxy-agent": "^5.0.0",
    "ng-click-outside": "^6.0.0",
    "ngx-bootstrap": "^5.6.1",
    "ngx-cookie-service": "^10.0.1",
    "ngx-mask": "^9.1.2",
    "ngx-select-dropdown": "^1.5.0",
    "ngx-spinner": "^10.0.1",
    "ngx-toastr": "^12.0.0",
    "rxjs": "~6.5.4",
    "tslib": "^1.14.1",
    "typescript-require": "^0.3.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-builders/custom-webpack": "9.1.0",
    "@angular-builders/dev-server": "7.3.1",
    "@angular-devkit/build-angular": "0.900.7",
    "@angular/cli": "9.0.1",
    "@angular/compiler-cli": "9.0.0",
    "@angular/language-service": "9.0.0",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~5.18.0",
    "typescript": "3.7.5"
  }
}

tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}
SDAdham commented 3 years ago

I am getting a similar error as it looks that this library is not compatible with ngcc:

This likely means that the library (ngx-select-dropdown) which declares SelectDropDownModule 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.

manishjanky commented 3 years ago

Please update to v2.0.0 Let me know if you face issues

SDAdham commented 3 years ago

I created another separate issue for this one at #231

SDAdham commented 3 years ago

Hello @manishjanky , my apologizes. I think my morning coffee wasn't good as the new error is not related to your library.