valor-software / ng2-select

Angular based replacement for select boxes
http://valor-software.github.io/ng2-select/
MIT License
676 stars 588 forks source link

webpack.js --env.prod command throw error after adding ng2-select in modules #931

Open KIBASSA opened 6 years ago

KIBASSA commented 6 years ago

Hi,

I have a problem deploying in ng2-select production. In local, on the dev machine, it works without problem but when I try to compile to publish in production, I get an error.

To compile, I use: C:\MyProjectPath> node node_modules/webpack/bin/webpack.js --env.prod

And I get this error:

ERROR in C:/Users/User/source/repos/CineBot/Emiko.Site.Client/$$_gendir/node_modules/ng2-select/select/select.ngfactory.ts (34,42): Argument of type 'string[]' is not assignable to parameter of type '{ [p: string]: number; }'. Index signature is missing in type 'string[]'.

ERROR in C:/Users/User/source/repos/CineBot/Emiko.Site.Client/$$_gendir/node_modules/ng2-select/select/select.ngfactory.ts (194,42): Argument of type 'string[]' is not assignable to parameter of type '{ [p: string]: number; }'.

ERROR in C:/Users/User/source/repos/CineBot/Emiko.Site.Client/$$_gendir/node_modules/ng2-select/select/select.ngfactory.ts (272,15): Argument of type 'string[]' is not assignable to parameter of type '{ [p: string]: number; }'.

ERROR in C:/Users/User/source/repos/CineBot/Emiko.Site.Client/$$_gendir/node_modules/ng2-select/select/select.ngfactory.ts (309,42): Argument of type 'string[]' is not assignable to parameter of type '{ [p: string]: number; }'.

ERROR in C:/Users/User/source/repos/CineBot/Emiko.Site.Client/$$_gendir/node_modules/ng2-select/select/select.ngfactory.ts (403,42): Argument of type 'string[]' is not assignable to parameter of type '{ [p: string]: number; }'.

ERROR in C:/Users/User/source/repos/CineBot/Emiko.Site.Client/$$_gendir/node_modules/ng2-select/select/select.ngfactory.ts (486,15): Argument of type 'string[]' is not assignable to parameter of type '{ [p: string]: number; }'.

And doing things gradually, I noticed that I get the error when SelectModule is added in @NgModule imports.

Do you have any idea why I made that mistake?

Thanks

optimistex commented 6 years ago

Hi. Try to use that fork: https://github.com/optimistex/ng2-select-ex