Title: Angular elements throws error when an element is consumed by root app and another element · Issue #32726 · angular/angular · GitHub
Open Graph Title: Angular elements throws error when an element is consumed by root app and another element · Issue #32726 · angular/angular
X Title: Angular elements throws error when an element is consumed by root app and another element · Issue #32726 · angular/angular
Description: 🐞 bug report Affected Package The issue may be caused by package @angular/core Description If i make an app1 with angular elements, and export this app1 to use those elements in another app it works just fine. The problem is when I want ...
Open Graph Description: 🐞 bug report Affected Package The issue may be caused by package @angular/core Description If i make an app1 with angular elements, and export this app1 to use those elements in another app it work...
X Description: 🐞 bug report Affected Package The issue may be caused by package @angular/core Description If i make an app1 with angular elements, and export this app1 to use those elements in another app it work...
Opengraph URL: https://github.com/angular/angular/issues/32726
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular elements throws error when an element is consumed by root app and another element","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄\r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\nThe issue may be caused by package @angular/core\r\n\r\n### Description\r\nIf i make an app1 with angular elements, and export this app1 to use those elements in another app it works just fine.\r\n\r\nThe problem is when I want to make a second app2 with elements (to export more complex elements), which also uses elements from my app1 as external elements, and use both app1 and app2 as external elements in a third app3.\r\n\r\nIf in my app3, i just use elements from app1, or just from app2 it works just fine.\r\nBut when i use both it throws the following error:\r\n\r\nError: Failed to execute 'define' on 'CustomElementRegistry': the name \"blue-element\" has already been used with this registry\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\n\u003c!--\r\nPlease create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-issue-repro2\r\n-->\r\nI made this two based on [the article made by Tomas Trajan](https://medium.com/@tomastrajan/the-best-way-to-lazy-load-angular-elements-97a51a5c2007)\r\n\r\nfirst app exported:\r\nhttps://github.com/SantiagoIlli/simple-angular-element\r\n\r\nthis one exports blue-element (a very simple angular element)\r\n\r\nsecond app exported:\r\nhttps://github.com/SantiagoIlli/complex-angular-element\r\n\r\nthis one exports orange-with-blue-inside (is a simple angular element that use blue-element in it)\r\n\r\nYou can see the error in this stackblitz:\r\n\r\nhttps://stackblitz.com/edit/angular-qwrhdz\r\n\r\nThese are two repos to show how did I create the apps to export as external elements.\r\n\r\nNotice that if blue-element is used and orange-with blue is not used, works fine. If orange-with-blue is used and blue-element is not used, it also works fine.\r\nThe problem is when i try to use both of them.\r\n\r\n\r\n\u003c!--\r\nIf StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue.\r\nA good way to make a minimal reproduction is to create a new app via `ng new repro-app` and add the minimum possible code to show the problem. \r\nShare the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.\r\n\r\n\r\nYou can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue\r\n-->\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\n\u003c!-- If the issue is accompanied by an exception or an error, please share it below: -->\r\n\u003c!-- ✍️-->\r\nError: Failed to execute 'define' on 'CustomElementRegistry': the name \"blue-element\" has already been used with this registry\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\n\u003c!-- run `ng version` and paste output below -->\r\n\u003c!-- ✍️-->\r\nAngular CLI: 8.3.4\r\nNode: 10.15.3\r\nOS: win32 x64\r\nAngular: 8.2.6\r\n... animations, common, compiler, compiler-cli, core, elements\r\n... forms, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.803.4\r\n@angular-devkit/build-angular 0.803.4\r\n@angular-devkit/build-optimizer 0.803.4\r\n@angular-devkit/build-webpack 0.803.4\r\n@angular-devkit/core 8.0.0\r\n@angular-devkit/schematics 8.0.0\r\n@angular/cdk 8.2.0\r\n@angular/cli 8.3.4\r\n@angular/flex-layout 8.0.0-beta.27\r\n@ngtools/webpack 8.3.4\r\n@schematics/angular 8.0.0\r\n@schematics/update 0.803.4\r\nrxjs 6.4.0\r\ntypescript 3.5.3\r\nwebpack 4.39.2\r\n\r\n\u003c/code>\u003c/pre>\r\n\r\n","author":{"url":"https://github.com/SantiagoIlli","@type":"Person","name":"SantiagoIlli"},"datePublished":"2019-09-17T19:21:46Z","url":"https://github.com/angular/angular/issues/32726"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67072f00-eae8-b8ab-9bf6-2b851ef6d809 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCE8:2E5652:155EFFF:1B3C582:6B01314A |
| html-safe-nonce | de5518c304efca2dcdf7e22fdcc3eb19535b39e416a7d1e54256db2935208d4b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0U4OjJFNTY1MjoxNTVFRkZGOjFCM0M1ODI6NkIwMTMxNEEiLCJ2aXNpdG9yX2lkIjoiNjc0NTgxMjAzNjQ2NDIyNjYzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2577c058562b5653a9264a51b6249fa2370fd764c78f56b34958c29bce1b1990 |
| hovercard-subject-tag | issue:494806383 |
| 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/32726/issue_layout |
| twitter:image | https://opengraph.githubassets.com/36d5de8ef988ab0b5a16c6ea75ef551f7ad3db8048598d2c9c03bc4c51266d97/angular/angular/issues/32726 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/36d5de8ef988ab0b5a16c6ea75ef551f7ad3db8048598d2c9c03bc4c51266d97/angular/angular/issues/32726 |
| og:image:alt | 🐞 bug report Affected Package The issue may be caused by package @angular/core Description If i make an app1 with angular elements, and export this app1 to use those elements in another app it work... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SantiagoIlli |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width