rd-dev-ukraine / angular-io-datepicker

MIT License
21 stars 18 forks source link

Getting compiler error while building app with ng build -prod #6

Open proreytech opened 7 years ago

proreytech commented 7 years ago

Hi, I am using datepicker in my app and it works fine with ng build but fails with ng build -prod. I googled and it looks like AOT compiler issue with ControlValueAccessorProviderFactory

https://github.com/angular/angular-cli/issues/4956

Here is error log:

prorey:provenbid proandrey$ ng build -prod
Hash: f7999b29dd0942099ae8                                                              
Time: 7383ms
chunk    {0} main.80551e71e70561828313.bundle.js (main) 1.33 kB {2} [initial] [rendered]
chunk    {1} styles.a5e033767d934a9d8d20.bundle.css (styles) 69 bytes {3} [initial] [rendered]
chunk    {2} vendor.c85a90b3d399a6fd167d.bundle.js (vendor) 1.04 MB [initial] [rendered]
chunk    {3} inline.a5d290ac24c45edf489b.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in Error encountered resolving symbol values statically. Calling function 'ControlValueAccessorProviderFactory', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol DatePicker in /Users/proandrey/Projects/provenbid/node_modules/angular-io-datepicker/src/datepicker/datePicker.d.ts, resolving symbol DatePicker in /Users/proandrey/Projects/provenbid/node_modules/angular-io-datepicker/src/datepicker/datePicker.d.ts

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/proandrey/Projects/provenbid/src'
 @ ./src/main.ts 5:0-74
 @ multi ./src/main.ts
demodav commented 7 years ago

I am having the same issue

b4p3p commented 7 years ago

me too

mattn9x commented 7 years ago

Please help me. I am having the sample issue!

WillAcon commented 7 years ago

me too

xiaoshitou666 commented 7 years ago

me too

khan8698 commented 7 years ago

me too!! any one got any solution ??

WillAcon commented 7 years ago

try this: ng build --prod --aot=false

khan8698 commented 7 years ago

@WillAcon Thanks for the help... it works perfectly as i desired but there is a small problem. Can you tell me that is there any way (like setting any variable in configuration) where i can set configuration for setting "AOT" to false ? Thanks

shankargounder commented 6 years ago

@WillAcon ng build --prod --aot=false it works fine but '--aot=false' increase our file size .. do u have any solution to reduce the size of file

Thanks

muniraj65 commented 6 years ago

ERROR in Error encountered resolving symbol values statically. Calling function 'ControlValueAccessorProviderFactory', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol DatePicker in /Users/munirajselvam/projects/muniraj/employeetimesheet/app/web/app/agency/node_modules/angular-io-datepicker/src/datepicker/datePicker.d.ts, resolving symbol DatePicker in /Users/munirajselvam/projects/muniraj/employeetimesheet/app/web/app/agency/node_modules/angular-io-datepicker/src/datepicker/datePicker.d.ts