Title: Angular 13 Custom Elements + APP_INITIALIZER = ERROR TypeError: Object.defineProperty called on non-object · Issue #46822 · angular/angular · GitHub
Open Graph Title: Angular 13 Custom Elements + APP_INITIALIZER = ERROR TypeError: Object.defineProperty called on non-object · Issue #46822 · angular/angular
X Title: Angular 13 Custom Elements + APP_INITIALIZER = ERROR TypeError: Object.defineProperty called on non-object · Issue #46822 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? elements, Don't known / other Is this a regression? No Description Angular 13 custom elements + APP_INITIALIZER gives the following error. ERROR TypeError: Object.defineProperty call...
Open Graph Description: Which @angular/* package(s) are the source of the bug? elements, Don't known / other Is this a regression? No Description Angular 13 custom elements + APP_INITIALIZER gives the following error. ERR...
X Description: Which @angular/* package(s) are the source of the bug? elements, Don't known / other Is this a regression? No Description Angular 13 custom elements + APP_INITIALIZER gives the following error....
Opengraph URL: https://github.com/angular/angular/issues/46822
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular 13 Custom Elements + APP_INITIALIZER = ERROR TypeError: Object.defineProperty called on non-object","articleBody":"### Which @angular/* package(s) are the source of the bug?\r\n\r\nelements, Don't known / other\r\n\r\n### Is this a regression?\r\n\r\nNo\r\n\r\n### Description\r\n\r\nAngular 13 custom elements + APP_INITIALIZER gives the following error. `ERROR TypeError: Object.defineProperty called on non-object`. Its was working fine in Angular 11. After migrating to angular 13, it stopped working. Any help is massively appreciated.\r\n\r\n**app.module.ts**\r\n```ts\r\n\r\nexport function startupServiceFactory(elementsStartupService: ElementsStartupService) {\r\n return () => elementsStartupService.init();\r\n}\r\n\r\n@NgModule({\r\n imports: [\r\n . . .\r\n ],\r\n providers: [\r\n . . ., \r\n {\r\n provide: APP_INITIALIZER,\r\n useFactory: startupServiceFactory,\r\n deps: [ElementsStartupService],\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class AppModule {\r\n constructor(private injector: Injector) {}\r\n ngDoBootstrap() {\r\n customElements.define(\r\n 'site-notice',\r\n createCustomElement(SiteNoticeComponent, {injector: this.injector}));\r\n }\r\n \r\n}\r\n```\r\n\r\nIn `pollyfills.ts`\r\n```ts\r\nimport 'zone.js'; // Included with Angular CLI.\r\n```\r\n\r\n### Please provide a link to a minimal reproduction of the bug\r\n\r\n_No response_\r\n\r\n### Please provide the exception or error you saw\r\n\r\n```true\r\nTypeError: Object.defineProperty called on non-object\r\n at Function.n (polyfill-1651189218.js:1:2523)\r\n at mr (cjs.js:7:1)\r\n at v (cjs.js:12:1)\r\n at elements.mjs:450:49\r\n at dL (elements.mjs:450:49)\r\n at t.value (app.module.ts:55:7)\r\n at t.value (core.mjs:26222:32)\r\n at core.mjs:26189:26\r\n at y.value (zone.js:372:26)\r\n at Object.onInvoke (core.mjs:25608:33)\r\n```\r\n```\r\n\r\n\r\n### Please provide the environment you discovered this bug in (run `ng version`)\r\n\r\n```true\r\nAngular CLI: 13.3.8\r\nNode: 14.19.3\r\nPackage Manager: npm 8.9.0\r\nOS: linux x64\r\n\r\nAngular: 13.3.11\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.1303.8\r\n@angular-devkit/build-angular 13.3.8\r\n@angular-devkit/core 13.3.8\r\n@angular-devkit/schematics 13.3.8\r\n@angular/cdk 13.3.9\r\n@angular/cli 13.3.8\r\n@angular/flex-layout 13.0.0-beta.38\r\n@angular/material 13.3.9\r\n@angular/material-moment-adapter 13.3.9\r\n@schematics/angular 13.3.8\r\nrxjs 6.6.7\r\ntypescript 4.6.4\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\n_No response_","author":{"url":"https://github.com/dinbtechit","@type":"Person","name":"dinbtechit"},"datePublished":"2022-07-13T15:50:53Z","url":"https://github.com/angular/angular/issues/46822"}
| 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:929d63be-57f7-99c2-557c-51b050b84773 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC2A:3E418A:1BA51D6:244341B:6B021CB2 |
| html-safe-nonce | d334a03e3fddab302602f3fa0eccd3af43e870366e408dba01763391e6ccc9a1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzJBOjNFNDE4QToxQkE1MUQ2OjI0NDM0MUI6NkIwMjFDQjIiLCJ2aXNpdG9yX2lkIjoiMzI2MTg3NDU3NzU4Nzk2OTIwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 24038c2bf4b091264814d428835c8964c00aaddb5f7ea5153b35cdd6aba9db41 |
| hovercard-subject-tag | issue:1303631938 |
| 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/46822/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7fde3afa2576bc1c2d9318f0e1c12c018177719965895a88053f698081fc7845/angular/angular/issues/46822 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7fde3afa2576bc1c2d9318f0e1c12c018177719965895a88053f698081fc7845/angular/angular/issues/46822 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? elements, Don't known / other Is this a regression? No Description Angular 13 custom elements + APP_INITIALIZER gives the following error. ERR... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dinbtechit |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width