You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In both cases it compiles with angular cli, and seems to be working correctly at runtime, but (at runtime/in the browser) I get the following error:
Uncaught TypeError: Object.defineProperty called on non-object
at defineProperty (<anonymous>)
at de (bundle.min.mjs:1:23388)
at ve (bundle.min.mjs:1:23516)
at 40497 (bundle.min.mjs:1:23679)
at __webpack_require__ (bootstrap:19:1)
at 77935 (polyfills.js:14:83)
at __webpack_require__ (bootstrap:19:1)
at __webpack_exec__ (wrapAsyncGenerator.js:6:1)
at wrapAsyncGenerator.js:6:1
at webpackJsonpCallback (jsonp chunk loading:71:1)
To Reproduce
Steps to reproduce the behavior:
create new angular cli project: npx ng new
npm i iterator-helpers-polyfill
add import 'iterator-helpers-polyfill'; to polyfills.ts
Additional context
To get the types correctly for the IDE, one should add "node_modules/iterator-helpers-polyfill/declarations" to typeRoots in tsconfig.json.
The text was updated successfully, but these errors were encountered:
First:
I am honestly deeply impressed by the quality of this issue and I want to give immense respects and I absolutely love the work you have put into this issue. I am grateful to you again so much I can't even start to express how this is well done. Great job, my friend!
Second:
The main issue here arises from the fact that angular polyfills async generators and I can only prevent only this error from throwing by falling back to dynamically compiled function that in runtime would get the native async generator function and then the async generator prototype, but the fix is largely impossible without a good async generator polyfill that will make a prototype to async generators to which I could cling to (the main proposal is about adding methods to async iterators prototype, from which async generator's prototype inherits the methods) but the angular's polyfill doesn't give any to work with and I can only recommend you to tweak babel's configuration from polyfilling the async generator functions and I am sure that my polyfill will work properly.
P.S. The async generator functions polyfill that babel uses is able to only provide basic functions of async generators but currently it doesn't have any of the prototype chain stuff so maybe it is worth opening an issue on the polyfill's github page that babel uses. I am not sure but I think it's regenerator-runtime. Maybe it is not something that babel uses when native generator functions are available, so I advise you to walk through babel's dependency tree and find something linked to generators.
P.P.S. I should mention about this on project's page. I will make a commit to address this tomorrow.
Describe the bug
I tried to add this to the Angular
polyfills.ts
(see https://angular.io/guide/browser-support#polyfills). I tried different setups:and as well simply importing:
In both cases it compiles with angular cli, and seems to be working correctly at runtime, but (at runtime/in the browser) I get the following error:
To Reproduce
Steps to reproduce the behavior:
npx ng new
npm i iterator-helpers-polyfill
import 'iterator-helpers-polyfill';
topolyfills.ts
ng serve
Alternatively you can checkout https://github.com/daniel-sc/angular-reproduction-iterator-helpers-polyfill and run
npm i && npm run start
and observe the error on http://localhost:4200Expected behavior
There should be no error.
Additional context
To get the types correctly for the IDE, one should add
"node_modules/iterator-helpers-polyfill/declarations"
totypeRoots
intsconfig.json
.The text was updated successfully, but these errors were encountered: