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
Note:
When I specify CONST instead of LET
export const options: Partial
I get the following error:
'const' declarations must be initialized.
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.
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) = {};