In our application we are using Angular(version 10) and ngrx(version 7). My app was running fine till I changed the tsconfig. I changed the below property:
"module": "commonjs"
to
"module": "es2020"
From then I started getting the below error:
Uncaught ReferenceError: Cannot access 'jobTreeReducers' before initialization
Following is the folder structure for the error raised module
The job-tree-store.module.ts is
import { NgModule } from "@angular/core";
import { StoreModule } from "@ngrx/store";
import { EffectsModule } from "@ngrx/effects";
import { CommonModule } from '@angular/common';
import { jobTreeReducers, JobTreeEffects } from "./index";
@NgModule({
imports: [
CommonModule,
StoreModule.forFeature('jobTree', jobTreeReducers),
EffectsModule.forFeature([JobTreeEffects]),
]
})
export class JobTreeStoreModule {}
I imported that and using in the App Module.
Please help me solve this issue.
Thanks...