In my Angular 12 app I have a module like
@NgModule({
imports: [ window.config.myConfXY ? ModuleX : ModuleY ],
providers: [ ... ],
declarations: [ ]
})
export class AppModule { }
but the compiler complains with: "A value for 'window' cannot be determined statically, as it is an external declaration."
I am trying to deploy the app in an nginx container passing in some environment variables. A generated "env.js" is referenced in index.html and defines the window.config.
What does the error mean and how can I fix that? Unfortunately, I found nothing useful regarding the error description on the web.