Closed changLiuUNSW closed 7 years ago
getting error when using ng build --prod. I uninstalled/installed again and get the same error:
ERROR in Unexpected value 'SlimScroll in G:/code/node_modules/angular-io-slimscroll/slimscroll.directive.d.ts' declared by the module 'AppModule in G:/code/src/app/app.module.ts'. Please add a @Pipe/@Directive/@Component annotation.
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'G:\code\src' @ ./src/main.ts 5:0-74 @ multi ./src/main.ts
my solution: I added following lines to /node_modules/angular-io-slimscroll/slimscroll.directive.d.ts:
import { Directive, Input } from '@angular/core';
@Directive({
selector: '[slimScroll]',
})
and I added @Input() before all property:
@Input() width: string;
@Input() height: string;
@Input() size: string;
@Input() color: string;
@Input() position: string;
@Input() distance: string;
@Input() start: string;
@Input() opacity: number;
@Input() transition: number;
@Input() alwaysVisible: boolean;
@Input() disableFadeOut: boolean;
@Input() railVisible: boolean;
@Input() railColor: string;
@Input() railOpacity: number;
@Input() railClass: string;
@Input() barClass: string;
@Input() wrapperClass: string;
@Input() allowPageScroll: boolean;
@Input() wheelStep: number;
@Input() touchScrollStep: number;
@Input() borderRadius: string;
@Input() railBorderRadius: string;
@Input() scrollTo: number;
@Input() autoScrollToBottom: boolean;
it's works fine for me
@tsubakka : That worked. I was able to able to get a prod aot build working. Thanks!
Fixed. Thanks to @tsubakka .
When I use ng build --prod
I get following error:
Time: 32243ms chunk {0} polyfills.f601bd19ae3b085f54cc.bundle.js (polyfills) 484 kB {4} [in itial] [rendered] chunk {1} main.9102f8247b4ec69c84ef.bundle.js (main) 679 bytes {3} [initial] [rendered] chunk {2} styles.70a47a3067606d26cff4.bundle.css (styles) 69 bytes {4} [initi al] [rendered] chunk {3} vendor.8926293ea10a95f0b8d0.bundle.js (vendor) 806 kB [initial] [re ndered] chunk {4} inline.b27704059dd0a1e0b33f.bundle.js (inline) 0 bytes [entry] [ren dered]
ERROR in Unexpected value 'SlimScroll in D:/dev/homeinsurancequoteandapply/src/a pp/HomeInsuranceQuoteAndApply.Web/client/node_modules/angular-io-slimscroll/slim scroll.directive.d.ts' declared by the module 'TooltipModule in D:/dev/homeinsur ancequoteandapply/src/app/HomeInsuranceQuoteAndApply.Web/client/src/app/shared/t ooltip/tooltip.ts'. Please add a @Pipe/@Directive/@Component annotation.
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\dev\homeinsurancequoteandapply\src\app\HomeInsuranceQuoteAndApply.Web\clien t\src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts