René's URL Explorer Experiment


Title: ERROR in RangeError: Maximum call stack size exceeded on production build and faulty export on module · Issue #19979 · angular/angular · GitHub

Open Graph Title: ERROR in RangeError: Maximum call stack size exceeded on production build and faulty export on module · Issue #19979 · angular/angular

X Title: ERROR in RangeError: Maximum call stack size exceeded on production build and faulty export on module · Issue #19979 · angular/angular

Description: Moved over from angular/angular-cli#8187, opened by @BartNetJS. Bug Report or Feature Request (mark with an x) - [x] bug report - [ ] feature request Versions. @angular/cli: 1.4.9 node: 8.7.0 os: win32 x64 @angular/animations: 4.4.6 @ang...

Open Graph Description: Moved over from angular/angular-cli#8187, opened by @BartNetJS. Bug Report or Feature Request (mark with an x) - [x] bug report - [ ] feature request Versions. @angular/cli: 1.4.9 node: 8.7.0 os: w...

X Description: Moved over from angular/angular-cli#8187, opened by @BartNetJS. Bug Report or Feature Request (mark with an x) - [x] bug report - [ ] feature request Versions. @angular/cli: 1.4.9 node: 8.7.0 os: w...

Opengraph URL: https://github.com/angular/angular/issues/19979

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ERROR in RangeError: Maximum call stack size exceeded on production build and faulty export on module","articleBody":"Moved over from https://github.com/angular/angular-cli/issues/8187, opened by @BartNetJS.\r\n\r\n---\r\n\r\n### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report \r\n- [ ] feature request\r\n```\r\n\r\n### Versions.\r\n@angular/cli: 1.4.9\r\nnode: 8.7.0\r\nos: win32 x64\r\n@angular/animations: 4.4.6\r\n@angular/common: 4.4.6\r\n@angular/compiler: 4.4.6\r\n@angular/core: 4.4.6\r\n@angular/forms: 4.4.6\r\n@angular/http: 4.4.6\r\n@angular/platform-browser: 4.4.6\r\n@angular/platform-browser-dynamic: 4.4.6\r\n@angular/router: 4.4.6\r\n@angular/cli: 1.4.9\r\n@angular/compiler-cli: 4.4.6\r\n@angular/language-service: 4.4.6\r\ntypescript: 2.3.4\r\n\r\n### Repro steps.\r\nCreate a module and export the same module in the export tag (this is the fault)\r\n```\r\n@NgModule({\r\n  imports: [CommonModule],\r\n  exports: [ MyFaultyModule ],\r\n  declarations: [MyFaultyComponent],\r\n  providers: [],\r\n})\r\nexport class MyFaultyModule { }\r\n```\r\nBuild a production build:\r\nng build --prod\r\n\r\n### The log given by the failure.\r\nERROR in RangeError: Maximum call stack size exceeded\r\n    at StaticReflector.annotations (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:1:1)\r\n    at NgModuleResolver.resolve (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:14750:70)\r\n    at CompileMetadataResolver.getNgModuleMetadata (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15402:60)\r\n    at CompileMetadataResolver.getNgModuleSummary (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15358:52)\r\n    at PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15450:68\r\n    at Array.forEach (\u003canonymous>)\r\n    at CompileMetadataResolver.getNgModuleMetadata (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15445:49)\r\n    at CompileMetadataResolver.getNgModuleSummary (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15358:52)\r\n    at PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15450:68\r\n    at Array.forEach (\u003canonymous>)\r\n    at CompileMetadataResolver.getNgModuleMetadata (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15445:49)\r\n    at CompileMetadataResolver.getNgModuleSummary (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15358:52)\r\n    at PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15450:68\r\n    at Array.forEach (\u003canonymous>)\r\n    at CompileMetadataResolver.getNgModuleMetadata (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15445:49)\r\n    at CompileMetadataResolver.getNgModuleSummary (PathRemovedForDemo\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:15358:52)\r\n\r\n### Desired functionality.\r\nThe ng cli should detect this fault and report the module that causes the call stack exception\r\n\r\n### Mention any other details that might be useful.\r\nThe issue can be found in **compile.umd.js**:\r\nfunction: **CompileMetadataResolver.prototype.getNgModuleMetadata **\r\nOn the code:\r\n\r\n```\r\n if (meta.exports) {\r\n            flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {\r\n                if (!isValidType(exportedType)) {\r\n                    _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(exportedType) + \"' exported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\r\n                    return;\r\n                }\r\n                var /** @type {?} */ exportedModuleSummary = _this.getNgModuleSummary(exportedType);                 if (exportedModuleSummary) {\r\n                    exportedModules.push(exportedModuleSummary);\r\n                }\r\n                else {\r\n                    exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));\r\n                }\r\n            });\r\n        }\r\n```\r\n\r\n**var  exportedModuleSummary = _this.getNgModuleSummary(exportedType); \r\n=> this cause the recursion and endless loop because 'getNgModuleMetadata ' is called again for the same module** \r\n\r\nSo my suggestion is watch how deep the recusion is going, and for example start logging warnings when reached 5 nested call.\r\nSomething like this:\r\n\r\n```\r\nCompileMetadataResolver.prototype.getNgModuleMetadata = function (moduleType, throwIfNotFound, nested = 0) {\r\n        nested++;\r\n        if(nested > 4) console.warn(´nested module {moduleType.name} (level: ${nested})´)\r\n```\r\nof course function calling **getNgModuleMetadata** should be modified to.\r\n\r\nCan someone on the core cli team confirm this is a good approach?\r\n\r\nAnother approach is of course checking for the module name that is calling it self, but suppose you have something like this moduleX=>export moduleY=>exportmoduleX...\r\n\r\nIf so, I will create a pull request","author":{"url":"https://github.com/filipesilva","@type":"Person","name":"filipesilva"},"datePublished":"2017-10-27T13:30:05Z","url":"https://github.com/angular/angular/issues/19979"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ce3cd98b-99cb-62a4-0c66-aebd9fa5545b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBF1E:317608:1A53058:2156AF9:6B01482A
html-safe-nonced206b3812c450113c39e0fad8e41ce2671efcefeea05290da41de8ccc8d59846
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjFFOjMxNzYwODoxQTUzMDU4OjIxNTZBRjk6NkIwMTQ4MkEiLCJ2aXNpdG9yX2lkIjoiMzAyNDgzNzEwNjM0MzE2ODA0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2932a190b0865b3b6a51d388f1d32521b8fe14ddcb5a9da35d4f4ecbded229cb
hovercard-subject-tagissue:269107632
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/19979/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8c642dd6fd3af3ea25cd5a656d94fe42f4ae9c7b0e79dbbabf8e479ec0f11859/angular/angular/issues/19979
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8c642dd6fd3af3ea25cd5a656d94fe42f4ae9c7b0e79dbbabf8e479ec0f11859/angular/angular/issues/19979
og:image:altMoved over from angular/angular-cli#8187, opened by @BartNetJS. Bug Report or Feature Request (mark with an x) - [x] bug report - [ ] feature request Versions. @angular/cli: 1.4.9 node: 8.7.0 os: w...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefilipesilva
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/19979#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F19979
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F19979
Sign uphttps://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
Reloadhttps://github.com/angular/angular/issues/19979
Reloadhttps://github.com/angular/angular/issues/19979
Reloadhttps://github.com/angular/angular/issues/19979
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/19979
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/19979
#21054https://github.com/angular/angular/pull/21054
ERROR in RangeError: Maximum call stack size exceeded on production build and faulty export on modulehttps://github.com/angular/angular/issues/19979#top
#21054https://github.com/angular/angular/pull/21054
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Oct 27, 2017https://github.com/angular/angular/issues/19979#issue-269107632
angular/angular-cli#8187https://github.com/angular/angular-cli/issues/8187
@BartNetJShttps://github.com/BartNetJS
https://github.com/SatyaCOD
SatyaCODhttps://github.com/SatyaCOD
on Nov 6, 2017https://github.com/angular/angular/issues/19979#issuecomment-342258978
jasonadenhttps://github.com/jasonaden
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
on Nov 9, 2017https://github.com/angular/angular/issues/19979#event-1335046072
https://github.com/MartinFreire
MartinFreirehttps://github.com/MartinFreire
on Nov 21, 2017https://github.com/angular/angular/issues/19979#issuecomment-346067601
Fuse http://fusetheme.com/angular
https://user-images.githubusercontent.com/13264154/33081701-b27fc302-ceb9-11e7-9db8-ccd19def798c.png
chuckjazhttps://github.com/chuckjaz
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
severity3: brokenhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
on Dec 15, 2017https://github.com/angular/angular/issues/19979#event-1390507931
chuckjazhttps://github.com/chuckjaz
on Dec 15, 2017https://github.com/angular/angular/issues/19979#event-1390508049
alxhubhttps://github.com/alxhub
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#21054https://github.com/angular/angular/pull/21054
on Dec 20, 2017https://github.com/angular/angular/issues/19979#event-1396691034
alxhubhttps://github.com/alxhub
on Dec 20, 2017https://github.com/angular/angular/issues/19979#event-1396691687
fix(compiler): report an error for recursive module referenceshttps://github.com/angular/angular/commit/ced575fd107e64f99651338a83975f4212b74fa5
https://docs.github.com/articles/closing-issues-via-commit-messages
ced575fhttps://github.com/angular/angular/commit/ced575fd107e64f99651338a83975f4212b74fa5
fix(compiler): report an error for recursive module referenceshttps://github.com/angular/angular/commit/33c0ee3441dc6b3e2e097d87640f9b163abd6950
https://docs.github.com/articles/closing-issues-via-commit-messages
33c0ee3https://github.com/angular/angular/commit/33c0ee3441dc6b3e2e097d87640f9b163abd6950
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 13, 2019https://github.com/angular/angular/issues/19979#issuecomment-531078939
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
chuckjazhttps://github.com/chuckjaz
on Sep 13, 2019https://github.com/angular/angular/issues/19979#event-2631067241
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 13, 2019https://github.com/angular/angular/issues/19979#event-2631067245
adhambaouzhttps://github.com/adhambaouz
on Nov 20, 2026https://github.com/angular/angular/issues/19979#event-36822356782
fix(compiler): report an error for recursive module referenceshttps://github.com/adhambaouz/angular/commit/f56d0c4e038228e04b83aaa4bc23f875acc77be4
https://docs.github.com/articles/closing-issues-via-commit-messages
f56d0c4https://github.com/adhambaouz/angular/commit/f56d0c4e038228e04b83aaa4bc23f875acc77be4
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/19979
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/19979
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
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.