Ngx-mask: ERROR WHEN RUN "ng build --prod --aot --vendor-chunk --common-chunk --delete-output-path --buildOptimizer"

Created on 23 May 2019  路  3Comments  路  Source: JsDaddy/ngx-mask

I'm getting an error when I run the following command:
ng build --prod --aot --vendor-chunk --common-chunk --delete-output-path --buildOptimizer

Error detail:
ERROR in Error during template compile of 'AppModule'
Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler in 'options'
'options' is not initialized at src\app\app.module.ts(32,12).

Line (32, 12):
export let options: Partial | (() => Partial);

Note:
When I specify CONST instead of LET
export const options: Partial | (() => Partial);
I get the following error:
'const' declarations must be initialized.

Most helpful comment

I do not know if it's the right way or not, but I've solved the problem by making the following change:
export const options: Partial | (() => Partial) = {};

All 3 comments

I do not know if it's the right way or not, but I've solved the problem by making the following change:
export const options: Partial | (() => Partial) = {};

I do not know if it's the right way or not, but I've solved the problem by making the following change:
export const options: Partial | (() => Partial) = {};

This solved my problem!

export const options: Partial<IConfig> | (() => Partial<IConfig>) = {};

Worked for me in Angular 8.0.0 with ng serve.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

humpedli picture humpedli  路  3Comments

Wisdomb33r picture Wisdomb33r  路  3Comments

prosto-artem picture prosto-artem  路  4Comments

TimWarp picture TimWarp  路  4Comments

raisiqueira picture raisiqueira  路  3Comments