Title: Zone.js attempts to patch "fetch" even when "common/fetch" is not imported. · Issue #36588 · angular/angular · GitHub
Open Graph Title: Zone.js attempts to patch "fetch" even when "common/fetch" is not imported. · Issue #36588 · angular/angular
X Title: Zone.js attempts to patch "fetch" even when "common/fetch" is not imported. · Issue #36588 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? Based on previous issue history, no. Description I am using angular in a web extension injected content script context. When the script i...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? Based on previous issue history, no. Description I am using angular in a web extension injected c...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? Based on previous issue history, no. Description I am using angular in a web extension injected c...
Opengraph URL: https://github.com/angular/angular/issues/36588
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Zone.js attempts to patch \"fetch\" even when \"common/fetch\" is not imported.","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 is caused by package @angular/zone.js\r\n\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\nBased on previous issue history, no.\r\n\r\n\r\n### Description\r\n\r\nI am using angular in a web extension injected content script context. When the script is injected by the background page, the following error appears in Firefox:\r\n\r\n\r\n\r\nThis looks to be the same issue tracked by: https://github.com/angular/zone.js/issues/1115 which was resolved by them through configuring `NgZone: 'noop'` and manually implementing change detection. The issue was closed as \"resolved in angular 7\" but that doesn't appear to be the case.\r\n\r\n## 🔬 Minimal Reproduction\r\nHere is my abbreviated `polyfills.ts`:\r\n\r\n```typescript\r\nimport 'zone.js/lib/zone';\r\nimport 'zone.js/lib/common/promise';\r\n```\r\n\r\nThe application is delivered from the background script to the tab via:\r\n\r\n```\r\nbrowser.tabs.executeScript({\r\n file: 'content-script/polyfills.js',\r\n allFrames: true\r\n});\r\n```\r\n\r\nRepo with readme to recreate this issue locally: https://github.com/spaceribs/zonejs-angular-issue\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\nERROR Error: \"\"fetch\" is read-only\" core.js:6189:19\r\n Angular 2\r\n defaultErrorLogger\r\n handleError\r\n error app.component.ts:145\r\n RxJS 13\r\n __tryOrUnsub\r\n error\r\n _error\r\n error\r\n _error\r\n error\r\n notifyError\r\n _error\r\n error\r\n notifyError\r\n _error\r\n error\r\n subscribeToPromise\r\n Angular 10\r\n invoke\r\n onInvoke\r\n invoke\r\n run\r\n scheduleResolveOrReject\r\n invokeTask\r\n onInvokeTask\r\n invokeTask\r\n runTask\r\n drainMicroTaskQueue\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\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.900.7\r\n@angular-devkit/build-angular 0.901.1\r\n@angular-devkit/build-optimizer 0.901.1\r\n@angular-devkit/build-webpack 0.901.1\r\n@angular-devkit/core 9.0.7\r\n@angular-devkit/schematics 9.0.7\r\n@angular/cdk 9.2.0\r\n@ngtools/webpack 9.1.1\r\n@schematics/angular 9.1.1\r\n@schematics/update 0.901.1\r\nrxjs 6.5.5\r\ntypescript 3.8.3\r\nwebpack 4.42.0\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\nThis is on Firefox 75\r\n\r\nI decided to dig a little deeper as well as compile zone.js myself in order to understand it a little better 😄.\r\n\r\nThe following lines appear to be the culprit, but I have little knowledge as to why fetch is being patched in `common/promise` rather than `common/fetch` by @JiaLiPassion :\r\nhttps://github.com/angular/zone.js/commit/ac3851ee31193a608a5bd12fbba90079e7328aca#diff-c87353777ac53dcde41fac9008e56425R492-R496\r\nnow at: https://github.com/angular/angular/blob/bf8ba89394ffd6d2047261e89d9f41e6ef66be3e/packages/zone.js/lib/common/promise.ts#L510-L514\r\n\r\nFor now in my project, I'm planning to copy this file and remove those lines.","author":{"url":"https://github.com/spaceribs","@type":"Person","name":"spaceribs"},"datePublished":"2020-04-12T12:46:18Z","url":"https://github.com/angular/angular/issues/36588"}
| 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:2cae12cb-f1d9-e046-b2f1-d4fa45e069c8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A694:1087D4:1B44F31:2464626:6B0161B1 |
| html-safe-nonce | 00ba1c4536d445e514f8a39aa0d5b97f890165286489f6c93cd418c2427cba7c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjk0OjEwODdENDoxQjQ0RjMxOjI0NjQ2MjY6NkIwMTYxQjEiLCJ2aXNpdG9yX2lkIjoiODg5MjU2MjU1NTAyMTY0ODMwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 59beeb2bebae56463c67c056adcfe5210ce26fb61a662aa20490c5bf580b7d77 |
| hovercard-subject-tag | issue:598477025 |
| 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/36588/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee21819ea184412eefe5bca1b3a57875392e35414f76d4e854e4a7236cec816b/angular/angular/issues/36588 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee21819ea184412eefe5bca1b3a57875392e35414f76d4e854e4a7236cec816b/angular/angular/issues/36588 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? Based on previous issue history, no. Description I am using angular in a web extension injected c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | spaceribs |
| 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