Title: Angular Schematics - Apply thousands of changes on tree cause error "Maximum call stack size exceeded" · Issue #17851 · angular/angular-cli · GitHub
Open Graph Title: Angular Schematics - Apply thousands of changes on tree cause error "Maximum call stack size exceeded" · Issue #17851 · angular/angular-cli
X Title: Angular Schematics - Apply thousands of changes on tree cause error "Maximum call stack size exceeded" · Issue #17851 · angular/angular-cli
Description: 🐞 Bug report Description I use Angular Schematics to migrate from AngularJs to Angular. The application is a large one with thousands of page. I try to create a component for each page based on a template. When I try to create the compon...
Open Graph Description: 🐞 Bug report Description I use Angular Schematics to migrate from AngularJs to Angular. The application is a large one with thousands of page. I try to create a component for each page based on a t...
X Description: 🐞 Bug report Description I use Angular Schematics to migrate from AngularJs to Angular. The application is a large one with thousands of page. I try to create a component for each page based on a t...
Opengraph URL: https://github.com/angular/angular-cli/issues/17851
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular Schematics - Apply thousands of changes on tree cause error \"Maximum call stack size exceeded\"","articleBody":"# 🐞 Bug report\r\n\r\n### Description\r\n\r\nI use Angular Schematics to migrate from AngularJs to Angular. The application is a large one with thousands of page. I try to create a component for each page based on a template. When I try to create the component on a smaller project like 200 pages it's working but when I fall on a large one with more than 1000 pages (1000 schematics rules)\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\n\u003cpre\u003e\u003ccode\u003e\r\nexport function createPageComponents(options: any): Rule {\r\n return (tree: Tree, context: SchematicContext) =\u003e {\r\n const logger = context.logger;\r\n const directory = tree.getDir('my_path/pages');\r\n\r\n const rules: Rule[] = [];\r\n directory.visit((filePath) =\u003e {\r\n if (!filePath.endsWith('config.ts')) {\r\n return;\r\n }\r\n\r\n const dirPath = dirname(filePath);\r\n const parsedPath = parseName(dirPath, basename(filePath).split('.')[0]);\r\n options = {\r\n path: parsedPath.path,\r\n name: parsedPath.name\r\n };\r\n\r\n const templateSource = apply(\r\n url('./files'),\r\n [\r\n applyTemplates({\r\n ...strings,\r\n ...options\r\n }),\r\n move(parsedPath.path)\r\n ]\r\n );\r\n\r\n const rule = mergeWith(templateSource);\r\n\r\n rules.push(rule);\r\n });\r\n\r\n return chain(rules);\r\n };\r\n}\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre\u003e\u003ccode\u003e\r\n RangeError: Maximum call stack size exceeded\r\n at Console.warn (\u003canonymous\u003e)\r\n at Observable._trySubscribe (my_path\\node_modules\\rxjs\\internal\\Observable.js:55:25)\r\n at Observable.subscribe (my_path\\node_modules\\rxjs\\internal\\Observable.js:30:22)\r\n at MergeMapOperator.call (my_path\\node_modules\\rxjs\\internal\\operators\\mergeMap.js:39:23)\r\n at Observable.subscribe (my_path\\node_modules\\rxjs\\internal\\Observable.js:25:31)\r\n at MapOperator.call (my_path\\node_modules\\rxjs\\internal\\operators\\map.js:32:23)\r\n at Observable.subscribe (my_path\\node_modules\\rxjs\\internal\\Observable.js:25:31)\r\n at MapToOperator.call (my_path\\node_modules\\rxjs\\internal\\operators\\mapTo.js:26:23)\r\n at Observable.subscribe (my_path\\node_modules\\rxjs\\internal\\Observable.js:25:31)\r\n at DefaultIfEmptyOperator.call (my_path\\node_modules\\rxjs\\internal\\operators\\defaultIfEmpty.js:27:23)\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\r\n\r\n## 🌍 Your Environment\r\n\u003cpre\u003e\u003ccode\u003e\r\nAngular CLI: 9.1.4\r\nNode: 10.19.0\r\nOS: win32 x64\r\n\r\nAngular: 9.1.4\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n------------------------------------------------------------\r\n@angular-devkit/architect 0.901.4\r\n@angular-devkit/build-angular 0.901.4\r\n@angular-devkit/build-ng-packagr 0.901.4\r\n@angular-devkit/build-optimizer 0.901.4\r\n@angular-devkit/build-webpack 0.901.4\r\n@angular-devkit/core 9.1.4\r\n@angular-devkit/schematics 9.1.7\r\n@angular-devkit/schematics-cli 0.901.7\r\n@angular/upgrade 9.1.9\r\n@ngtools/webpack 9.1.4\r\n@schematics/angular 9.1.4 (cli-only)\r\n@schematics/schematics 0.901.7\r\n@schematics/update 0.901.4\r\nng-packagr 9.1.3\r\nrxjs 6.5.5\r\ntypescript 3.8.3\r\nwebpack 4.42.0\r\n\u003c/code\u003e\u003c/pre\u003e\r\n","author":{"url":"https://github.com/fatalcaron","@type":"Person","name":"fatalcaron"},"datePublished":"2020-06-03T20:01:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/17851/angular-cli/issues/17851"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3781be1a-96f1-c92a-0863-fee78a1e5325 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A148:2CE08F:2C48C56:3D29A4C:6964F55F |
| html-safe-nonce | f420e7cf35078db0e4ae2b88a15dffab17888409cd5bb45dd3ebc9edea9ac870 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTQ4OjJDRTA4RjoyQzQ4QzU2OjNEMjlBNEM6Njk2NEY1NUYiLCJ2aXNpdG9yX2lkIjoiMTE2ODAyNTYxNzg2NDkxNDI3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0935cf3a5fccc5194f912264bcb7c8687afae6a145617ae8dc0bfe82355d4b44 |
| hovercard-subject-tag | issue:630286896 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/17851/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ab734d09292aba74895545c14cae0a05e5c2585178d6178ad2060e7d02f555bc/angular/angular-cli/issues/17851 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ab734d09292aba74895545c14cae0a05e5c2585178d6178ad2060e7d02f555bc/angular/angular-cli/issues/17851 |
| og:image:alt | 🐞 Bug report Description I use Angular Schematics to migrate from AngularJs to Angular. The application is a large one with thousands of page. I try to create a component for each page based on a t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fatalcaron |
| hostname | github.com |
| expected-hostname | github.com |
| None | 003e962bf5ca78f3f8f71db2461c6a7f9cfcbe99b480d6aeddaef78d33e9161a |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 21cbf6733480c5c09366f15b8dc8b6953472172a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width