René's URL Explorer Experiment


Title: Cannot read property 'properties' of undefined when adding a lazy loaded module with ng generate · Issue #21397 · angular/angular-cli · GitHub

Open Graph Title: Cannot read property 'properties' of undefined when adding a lazy loaded module with ng generate · Issue #21397 · angular/angular-cli

X Title: Cannot read property 'properties' of undefined when adding a lazy loaded module with ng generate · Issue #21397 · angular/angular-cli

Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Description While attempting to find the module to add a lazy loaded route declaration to while generating a...

Open Graph Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Description While attempting to find the module to add a lazy loaded...

X Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Description While attempting to find the module to add a lazy loaded...

Opengraph URL: https://github.com/angular/angular-cli/issues/21397

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot read property 'properties' of undefined when adding a lazy loaded module with ng generate","articleBody":"# 🐞 Bug report\r\n\r\n### Command (mark with an `x`)\r\n\r\n\u003c!-- Can you pin-point the command or commands that are effected by this bug? --\u003e\r\n\u003c!-- ✍️edit: --\u003e\r\n\r\n- [ ] new\r\n- [ ] build\r\n- [ ] serve\r\n- [ ] test\r\n- [ ] e2e\r\n- [x] generate\r\n- [ ] add\r\n- [ ] update\r\n- [ ] lint\r\n- [ ] extract-i18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n\r\n### Description\r\n\r\nWhile 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:\r\n\u003cpre\u003e\u003ccode\u003e\r\n[\r\n  '/src/app/areas',\r\n  '/src/app/areas/app.ts',\r\n  '/src/app/areas/app.module.ts'\r\n]\r\n\u003c/code\u003e\u003c/pre\u003e\r\nIf 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 \r\n`Cannot read property 'properties' of undefined` error down the line (node is undefined in `getMetadataField` in ast-utils).\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\n- Create a new angular project using `ng new`.\r\n- Create an empty file `src/app/app.ts`\r\n- Call `ng g m foo --routing --route=foo --module=app`\r\n\r\n## 🔥 Exception or Error\r\n\r\n`Cannot read property 'properties' of undefined`\r\n\r\n## 🌍 Your Environment\r\n\r\n\u003cpre\u003e\u003ccode\u003e\r\nAngular CLI: 12.1.3\r\nNode: 12.18.3\r\nPackage Manager: npm 6.14.6\r\nOS: win32 x64\r\n\r\nAngular: 12.1.3\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\r\n\r\nPackage                         Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect       0.1201.3\r\n@angular-devkit/build-angular   12.1.3\r\n@angular-devkit/core            12.1.3\r\n@angular-devkit/schematics      12.1.3\r\n@schematics/angular             12.1.3\r\nrxjs                            6.6.7\r\ntypescript                      4.3.5\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\r\n## Workaround\r\n\r\nTo work around this issue, we can specify the module by file name, not module name:\r\n\r\n`ng g m foo --routing --route=foo --module=app.module.ts`\r\n\r\n","author":{"url":"https://github.com/mjamin","@type":"Person","name":"mjamin"},"datePublished":"2021-07-22T08:19:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/21397/angular-cli/issues/21397"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:001b12ba-410e-08d2-3987-a638c4fc8888
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC24A:115C7:AE67EB:E7C7E0:6A604969
html-safe-nonceaf088a8ecba7159ace4ed6f53e7077f5864b7d39e1baae39f67821aaef52a534
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjRBOjExNUM3OkFFNjdFQjpFN0M3RTA6NkE2MDQ5NjkiLCJ2aXNpdG9yX2lkIjoiNTI5MTgyMDcxNjAzNTk1MDk1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd2f2939edfa26677a759efc7e771865b4d390e7087b477f0139a06ccb9a9db3e
hovercard-subject-tagissue:950414123
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/21397/issue_layout
twitter:imagehttps://opengraph.githubassets.com/920e91ac1b1b3156670795ee71ca12e4ffb28e7edc6474505f63c8f0c21ed56a/angular/angular-cli/issues/21397
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/920e91ac1b1b3156670795ee71ca12e4ffb28e7edc6474505f63c8f0c21ed56a/angular/angular-cli/issues/21397
og:image:alt🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Description While attempting to find the module to add a lazy loaded...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemjamin
hostnamegithub.com
expected-hostnamegithub.com
None60da8c2a42fa2bbf5f7567474990ec467836a84444262a58e200fa91b7f3d2d0
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9824515e740d83d5eb82168a089b806ab0fe04a1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/21397#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F21397
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F21397
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/21397
Reloadhttps://github.com/angular/angular-cli/issues/21397
Reloadhttps://github.com/angular/angular-cli/issues/21397
Please reload this pagehttps://github.com/angular/angular-cli/issues/21397
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 272 https://github.com/angular/angular-cli/issues
Pull requests 32 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality 5 https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
#22934https://github.com/angular/angular-cli/pull/22934
Cannot read property 'properties' of undefined when adding a lazy loaded module with ng generatehttps://github.com/angular/angular-cli/issues/21397#top
#22934https://github.com/angular/angular-cli/pull/22934
https://github.com/alan-agius4
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular-cli/milestone/12
https://github.com/mjamin
mjaminhttps://github.com/mjamin
on Jul 22, 2021https://github.com/angular/angular-cli/issues/21397#issue-950414123
alan-agius4https://github.com/alan-agius4
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
BacklogNo due datehttps://github.com/angular/angular-cli/milestone/12
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.