NileshPatel17 / ng-multiselect-dropdown

Multiple Select Dropdown Component
https://nileshpatel17.github.io/ng-multiselect-dropdown/
327 stars 287 forks source link

Error in build Angular 10 #283

Open ChristopheLej opened 3 years ago

ChristopheLej commented 3 years ago

Angular version: 10.0.8 ng-multiselect-dropdown version: ^0.2.10 Description of issue: Error when building: Error: Failed to compile entry-point ng-multiselect-dropdown (es2015 as esm2015) due to compilation errors: node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:28:17 - error NG2003: No suitable injection token for parameter 'listFilterPipe' of class 'MultiSelectComponent'. Consider adding a type to the parameter or use the @Inject decorator to specify an injection token. 28 constructor(listFilterPipe) {

node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:357:17 - error NG2003: No suitable injection token for parameter '_elementRef' of class 'ClickOutsideDirective'.
  Consider adding a type to the parameter or use the @Inject decorator to specify an injection token.
357     constructor(_elementRef) {

node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:417:24 - error NG6001: The class 'MultiSelectComponent' is listed in the declarations of the NgModule 'NgMultiSelectDropDownModule', but is not a directive, a component, or a pipe. Either remove it from the NgModule's declarations, or add an appropriate Angular decorator. 417 declarations: [MultiSelectComponent, ClickOutsideDirective, ListFilterPipe],

  node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:27:5
    27 let MultiSelectComponent = class MultiSelectComponent {
'MultiSelectComponent' is declared here.

node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:417:46 - error NG6001: The class 'ClickOutsideDirective' is listed in the declarations of the NgModule 'NgMultiSelectDropDownModule', but is not a directive, a component, or a pipe. Either remove it from the NgModule's declarations, or add an appropriate Angular decorator. 417 declarations: [MultiSelectComponent, ClickOutsideDirective, ListFilterPipe],

  node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:356:5
    356 let ClickOutsideDirective = class ClickOutsideDirective {
'ClickOutsideDirective' is declared here.

node_modules/ng-multiselect-dropdown/fesm2015/ng-multiselect-dropdown.js:27:5 - error NG6003: Appears in the NgModule.exports of NgMultiSelectDropDownModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class. Is it missing an Angular annotation? 27 let MultiSelectComponent = class MultiSelectComponent {

Solution: I limit the version of library to 0.2.12. in package.json : "ng-multiselect-dropdown": "0.2.12" From version 0.2.13, I have the bug.

Finally, I use version ^0.3.1 which seems compatible with my dev.

Thanks

NileshPatel17 commented 3 years ago

There was an issue. its fixed now with v0.3.1 and 0.2.13

TetianaNazarova commented 2 years ago

On adding in tsconfig.app.json: "angularCompilerOptions": { "enableIvy": true }

I got this error:

ERROR in No suitable injection token for parameter 'listFilterPipe' of class 'MultiSelectComponent'. no type or decorator npm ERR! code ELIFECYCLE npm ERR! errno 1

I installed the last version "ng-multiselect-dropdown": "^0.3.7",