diff --git a/packages/angular/src/generators/ngrx-root-store/lib/normalize-options.ts b/packages/angular/src/generators/ngrx-root-store/lib/normalize-options.ts index 48a2b86b06100..42df1dac6435a 100644 --- a/packages/angular/src/generators/ngrx-root-store/lib/normalize-options.ts +++ b/packages/angular/src/generators/ngrx-root-store/lib/normalize-options.ts @@ -45,11 +45,16 @@ export function normalizeOptions( * --> If so, use that * --> If not, use main.ts */ - const parent = !isStandalone - ? joinPathFragments(project.sourceRoot, 'app/app.module.ts') - : tree.exists(appConfigPath) - ? appConfigPath - : appMainPath; + const ngModulePath = joinPathFragments( + project.sourceRoot, + 'app/app.module.ts' + ); + const parent = + !isStandalone && tree.exists(ngModulePath) + ? ngModulePath + : tree.exists(appConfigPath) + ? appConfigPath + : appMainPath; options.directory = options.directory ?? '+state';