However, since the beginning of the process was ionic serve, this meant that from an Ionic point of view, everything happened in development mode. So I had no benefit from the performance gain by using Angular's AoT (Ahead-of-time compilation).
So I tried to do a real production build with ionic build. Unfortunately, it produced an error:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [12:51:11] ionic-app-scripts 0.0.39 [12:51:11] build prod started ... [12:51:11] clean started ... [12:51:11] clean finished in 7 ms [12:51:11] copy started ... [12:51:11] ngc started ... [12:51:11] copy finished in 455 ms [12:51:12] lint started ... [12:51:22] lint finished in 9.64 s [12:51:32] Error: Error at .../.tmp/app/app.module.ngfactory.ts:415:84 [12:51:32] Supplied parameters do not match any signature of call target. [12:51:32] ngc failed [12:51:32] ionic-app-script task: "build" [12:51:32] Error: Error |
1 2 3 4 | get _LoggingService_76():import46.LoggingService { if (( this .__LoggingService_76 == ( null as any))) { ( this .__LoggingService_76 = new import46.LoggingService()); } return this .__LoggingService_76; } |
1 2 3 4 5 6 7 8 | @NgModule({ ... providers: [ ConfigurationService LoggingService, ... ] }) |
1 2 3 4 5 | export declare class LoggingService { private configurationService; constructor(configurationService: ConfigurationService); ... } |
One workaround could be to changed the parameter to an optional one. A better workaround is to change the declaration of the provider in app.module.ts:
1 2 3 4 5 6 7 8 9 10 11 12 | @NgModule({ ... providers: [ ConfigurationService, { provide: LoggingService, useFactory: getLoggingService, deps: [ConfigurationService] }, ... ] }) |
1 2 3 | export function getLoggingService(configurationService: ConfigurationService): LoggingService { return new LoggingService(configurationService); } |
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.