You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot read property 'properties' of undefined when adding a lazy loaded module with ng generate #21397
While attempting to find the module to add a lazy loaded route declaration to while generating a new lazy loaded module with option --module=app, findModuleFromOptions tries file candidates from least to most specific:
If both app.module.ts and app.ts exist, app.ts is returned. If that file does not include an @angular/core import, this leads to an Cannot read property 'properties' of undefined error down the line (node is undefined in getMetadataField in ast-utils).
🔬 Minimal Reproduction
Create a new angular project using ng new.
Create an empty file src/app/app.ts
Call ng g m foo --routing --route=foo --module=app
Activity
iftee-hussain commentedon Jul 31, 2021
If the issue is not taken, I would like to give it a try.
tejas10191 commentedon Jul 31, 2021
I'm gonna give it a try too.
tejas10191 commentedon Jul 31, 2021
@alan-agius4 Ideally, it should skip the file-path without module.ts extension ?
iftee-hussain commentedon Jul 31, 2021
IMO it should skip the candidate file path without having
moduleExtkuldeepvishwakarma05 commentedon Sep 15, 2021
Angular CLI: 12.1.3
Node: 12.18.3
Package Manager: npm 6.14.6
OS: win32 x64
Angular: 12.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1201.3
@angular-devkit/build-angular 12.1.3
@angular-devkit/core 12.1.3
@angular-devkit/schematics 12.1.3
@schematics/angular 12.1.3
rxjs 6.6.7
typescript 4.3.5
aakash1003 commentedon Jan 8, 2022
if this is not resolved yet, then I would like to give it a try
Allencs16 commentedon Feb 8, 2022
I would like to try too if is not fixed
msarfrazanwar commentedon Feb 28, 2022
What is the expected fix for this Issue ? Append ".module.ts" after name pass in cli ?
fix(@schematics/angular): provide actionable error message when routi…
fix(@schematics/angular): provide actionable error message when routi…
angular-automatic-lock-bot commentedon May 5, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.