René's URL Explorer Experiment


Title: Angular Elements: DOMException when embedding other angular app · Issue #30951 · angular/angular · GitHub

Open Graph Title: Angular Elements: DOMException when embedding other angular app · Issue #30951 · angular/angular

X Title: Angular Elements: DOMException when embedding other angular app · Issue #30951 · angular/angular

Description: 🐞 bug report Affected Package @angular/elements Is this a regression? No Description Our use case is to create an angular agnostic shell that would be able to contain other web applications inside of it. I thought one possible candidate ...

Open Graph Description: 🐞 bug report Affected Package @angular/elements Is this a regression? No Description Our use case is to create an angular agnostic shell that would be able to contain other web applications inside ...

X Description: 🐞 bug report Affected Package @angular/elements Is this a regression? No Description Our use case is to create an angular agnostic shell that would be able to contain other web applications inside ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular Elements: DOMException when embedding other angular app","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n@angular/elements\r\n\r\n\r\n### Is this a regression?\r\nNo\r\n\r\n### Description\r\n\r\nOur use case is to create an angular agnostic shell that would be able to contain other web applications inside of it. I thought one possible candidate for this type of web app would be Angular Elements, since they are supposed to be agnostic and not interfere with the frameworks / scripts of other web applications.\r\n\r\nUnfortunately, when trying to embed an angular-cli generated application within a website containing Angular Elements, we get the following error:\r\n\r\n`Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry`\r\n\r\nIf ONE of the apps (The angular elements app or the angular-cli app) changes it's `\"optimizations\"` property in package.json to false, there will be no issue. Note: these optimizations are only triggered when running with the `--prod` flag when doing `ng build`\r\n\r\nBuilding both in production mode with the flag set to true (The default setting) results in this error.\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\n**Combined app index.html:**\r\n\r\n```\r\n\u003c!DOCTYPE html>\r\n\u003chtml lang=\"en\">\r\n\u003cbody>\r\n\u003capp-custom-element>\u003c/app-custom-element>\r\n\u003cscript src=\"./angular8app.js\">\u003c/script>\r\n\u003c!-- EMBEDDED APP START -->\r\n   \u003capp-root>\u003c/app-root>\r\n   \u003cscript type=\"text/javascript\" src=\"./runtime-es5.js\">\u003c/script>\u003cscript type=\"text/javascript\" \r\n   src=\"./main-es5.js\">\u003c/script>\r\n\u003c!-- EMBEDDED APP END -->\r\n\u003c/body>\r\n\u003c/html>\r\n```\r\n\r\n**Angular Element app.module:**\r\n\r\n```\r\nimport { BrowserModule } from '@angular/platform-browser';\r\nimport { CUSTOM_ELEMENTS_SCHEMA, NgModule, Injector } from '@angular/core';\r\nimport { CustomComponent } from './custom/custom.component';\r\nimport { createCustomElement } from '@angular/elements';\r\n\r\n@NgModule({\r\n  declarations: [\r\n    CustomComponent\r\n  ],\r\n  imports: [\r\n    BrowserModule\r\n  ],\r\n  providers: [],\r\n  entryComponents: [CustomComponent],\r\n  schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\nexport class AppModule {\r\n  constructor(injector: Injector) {\r\n    const customElement = createCustomElement(CustomComponent, {injector});\r\n      customElements.define('app-custom-element', customElement);\r\n  }\r\n  ngDoBootstrap() {}\r\n}\r\n```\r\n\r\n**batch script to create concatenated angular8app.js:**\r\n`ng build angular8-custom --prod --output-hashing=none && type \"dist\\angular8-custom\\runtime-es2015.js\" \"dist\\angular8-custom\\polyfills-es2015.js\" \"dist\\angular8-custom\\scripts.js\" \"dist\\angular8-custom\\main-es2015.js\" > \"output\\angular8app.js\"`\r\n\r\n**angular8app.js**: The script file for the angular element app, which is a concat of \"runtime.js, main.js and polyfills.js\"\r\n\r\n**app-custom-element**: The custom element tag, defined in app.module\r\n\r\n**app-root**: The app root of the embedded angular8 cli generated application.\r\n\r\n**Other scripts**: Scripts for the angular8 cli generated application.\r\n\r\n_Angular CLI app is all boilerplate / exactly what is generated from angular-cli_\r\n\r\n## 🔥 Exception or Error\r\n`Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry`\r\n\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:**\r\nAngular CLI: 8.0.2\r\nNode: 10.15.3\r\nOS: win32 x64\r\nAngular: 8.0.0\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.800.2\r\n@angular-devkit/build-angular     0.800.2\r\n@angular-devkit/build-optimizer   0.800.2\r\n@angular-devkit/build-webpack     0.800.2\r\n@angular-devkit/core              8.0.2\r\n@angular-devkit/schematics        8.0.2\r\n@angular/cli                      8.0.2\r\n@ngtools/webpack                  8.0.2\r\n@schematics/angular               8.0.2\r\n@schematics/update                0.800.2\r\nrxjs                              6.4.0\r\ntypescript                        3.4.5\r\nwebpack                           4.30.0\r\n\r\n**Anything else relevant?**\r\n\r\n","author":{"url":"https://github.com/xyfer","@type":"Person","name":"xyfer"},"datePublished":"2019-06-10T14:03:19Z","url":"https://github.com/angular/angular/issues/30951"}

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:61c941ae-8b80-c5af-c332-67689fc24267
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA322:6DC60:BEA6EA:EF4303:6B01311C
html-safe-noncec7c2d69f5cc08be7428090be7c8f385b39c9ec704496354374db9aba22f5e83a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzIyOjZEQzYwOkJFQTZFQTpFRjQzMDM6NkIwMTMxMUMiLCJ2aXNpdG9yX2lkIjoiNDgxOTE3OTc1NTc2Mjk1NDUyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0f47d95d471b8a3f6f98598b2f872a17103f217194afc6a6eaede60210e14555
hovercard-subject-tagissue:454187160
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/30951/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b955038d0f8705f1ecd359f73b3459858b7d6b7f77a7710e7bd620f15939a8bb/angular/angular/issues/30951
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b955038d0f8705f1ecd359f73b3459858b7d6b7f77a7710e7bd620f15939a8bb/angular/angular/issues/30951
og:image:alt🐞 bug report Affected Package @angular/elements Is this a regression? No Description Our use case is to create an angular agnostic shell that would be able to contain other web applications inside ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamexyfer
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/30951#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F30951
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%2F30951
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/30951
Reloadhttps://github.com/angular/angular/issues/30951
Reloadhttps://github.com/angular/angular/issues/30951
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/30951
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/30951
Angular Elements: DOMException when embedding other angular apphttps://github.com/angular/angular/issues/30951#top
area: elementsIssues related to Angular Elementshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20elements%22
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/xyfer
xyferhttps://github.com/xyfer
on Jun 10, 2019https://github.com/angular/angular/issues/30951#issue-454187160
https://github.com/ericmartinezr
ericmartinezrhttps://github.com/ericmartinezr
on Jun 10, 2019https://github.com/angular/angular/issues/30951#issuecomment-500439960
#23732 (comment)https://github.com/angular/angular/issues/23732#issuecomment-388670907
https://github.com/xyfer
xyferhttps://github.com/xyfer
on Jun 10, 2019https://github.com/angular/angular/issues/30951#issuecomment-500483521
herehttps://github.com/webpack/docs/wiki/configuration
IgorMinarhttps://github.com/IgorMinar
area: elementsIssues related to Angular Elementshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20elements%22
on Jun 11, 2019https://github.com/angular/angular/issues/30951#event-2402551800
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Jun 11, 2019https://github.com/angular/angular/issues/30951#event-2402551974
gkalpakhttps://github.com/gkalpak
triage #1https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22triage%20%231%22
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
on Jun 2, 2020https://github.com/angular/angular/issues/30951#event-3399506868
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Jul 11, 2020https://github.com/angular/angular/issues/30951#issuecomment-657104935
gkalpakhttps://github.com/gkalpak
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 11, 2020https://github.com/angular/angular/issues/30951#event-3536481837
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Aug 11, 2020https://github.com/angular/angular/issues/30951#issuecomment-672061554
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
on Aug 11, 2020https://github.com/angular/angular/issues/30951#event-3643967976
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/30951
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/30951
area: elementsIssues related to Angular Elementshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20elements%22
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
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.