Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pass isDevMode to forRoot throw error in Prod env

the code like as bellow

const isDev = isDevMode()
const modules = [
    HttpClientModule,
    NgxsModule.forRoot(AllStates, { developmentMode: isDev }),
]

this code work well in development env, but will throw an error in prod env. The error is Error during template compile of 'CoreModule' Function calls are not supported in decorators but 'isDevMode' was called.

Is there a way to pass isDevMode to forRoot function? Thanks

like image 883
xsong Avatar asked Apr 23 '26 21:04

xsong


1 Answers

Finally, I use const isDev = !environment.production , and work well.

like image 146
xsong Avatar answered Apr 26 '26 10:04

xsong