Title: [elements]: custom element inside a custom element's template throw on destruction · Issue #25525 · angular/angular · GitHub
Open Graph Title: [elements]: custom element inside a custom element's template throw on destruction · Issue #25525 · angular/angular
X Title: [elements]: custom element inside a custom element's template throw on destruction · Issue #25525 · angular/angular
Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submi...
Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ...
X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or reques...
Opengraph URL: https://github.com/angular/angular/issues/25525
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[elements]: custom element inside a custom element's template throw on destruction","articleBody":"## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x] Bug report \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n[ ] Other... Please describe:\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\nWe have 3 custom elements, A , B and C - All are angular components converted to custom elements.\r\n\r\nWe create a new A programatically, with an injector.\r\n\r\nInside A we append HTML code, the code includes markup that will create B. (B doesn't have an injector).\r\n\r\nIn B's template, we have markup to create C.\r\n\r\n---\r\n\r\nStopping here to point out that while C is inside an **angular template** markup and **it is an angular component,** the fact that it's declared as a custom element means that it will be handled by `@angular/elements`.\r\n\r\n---\r\n\r\nNow, **A** was created programatically so we have a reference for it. \r\nWe remove it (`NgElement.remove()`) which starts the destruction process.\r\n\r\nWhen `@angular/elements` starts the destruction process and error is thrown:\r\n\r\n**ERROR TypeError: Cannot read property 'nativeNode' of null**\r\n\u003cdetails>\r\n at removeDebugNodeFromIndex (core.js:5407)\r\n at DebugRenderer2.push.../../node_modules/@angular/core/fesm5/core.js.DebugRenderer2.destroyNode (core.js:11398)\r\n at destroyViewNodes (core.js:10613)\r\n at destroyView (core.js:10601)\r\n at callWithDebugContext (core.js:11351)\r\n at Object.debugDestroyView [as destroyView] (core.js:11035)\r\n at ViewRef_.push.../../node_modules/@angular/core/fesm5/core.js.ViewRef_.destroy (core.js:8868)\r\n at ComponentRef_.push.../../node_modules/@angular/core/fesm5/core.js.ComponentRef_.destroy (core.js:8705)\r\n at elements.js:236\r\n at ZoneDelegate.push.../../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)\r\n\u003c/details>\r\n\r\nThe error happens when `@anguar/core` try's to destory C.\r\n\r\nWhat happens is that ` DebugRenderer2.destroyNode()` is called **TWICE** for **C**.\r\nMy guess is that because C is a custom element used inside an angular template both angular and angular/elements invoke a destroy... something like that I guess.\r\n \r\n## Expected behavior\r\nShould not throw...\r\n\r\n> It's worth noting that even if I disable the delay of destruction it stlll throws","author":{"url":"https://github.com/shlomiassaf","@type":"Person","name":"shlomiassaf"},"datePublished":"2018-08-16T17:37:51Z","url":"https://github.com/angular/angular/issues/25525"}
| 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:8404dc5a-bbef-fcbf-2459-4e9a706b8405 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCEA:358871:18C26D2:2092D32:6B013BFF |
| html-safe-nonce | acc7e842962ce30eb97238e1fdfa6bed3152541741f9fd02a6e61e9537e2a802 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0VBOjM1ODg3MToxOEMyNkQyOjIwOTJEMzI6NkIwMTNCRkYiLCJ2aXNpdG9yX2lkIjoiNTYzNjAwOTQ5NTI0ODMyMTUzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 316a773a2d0c7ce42575ce9f10183f1858171ed8651e122ff883a1226b1dd55d |
| hovercard-subject-tag | issue:351301819 |
| 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/25525/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe3bb3d1df06813d49bca72639e89dde807c0a08275404945343a70dd6441512/angular/angular/issues/25525 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe3bb3d1df06813d49bca72639e89dde807c0a08275404945343a70dd6441512/angular/angular/issues/25525 |
| og:image:alt | I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shlomiassaf |
| 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