New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
sometime form .get return null #35219
Comments
I think it's the same issue like reported in #35214.
Some of the errors i have: |
This is really serious bug and should be dealt with immediately. |
We have the same bug in Production site, Angular (and Material) v7, it happens only on Chrome 80 |
Also have experienced this bug. By some reason it happens only once. If you can repeat the process after the error occurred it doesn't happen again. |
It's a production show stopper for us at the moment. Could you give an ETA of any kind about chrome fix or an official work around? |
i found someone found relate bug in other issue #35190 (comment) https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 |
so a quick fix would be to release a version of angular that does not use How long will it take for the chromium fix to trickle down for end users? |
What if we replaced Array.prototype.reduce() with a function that didn't fail? Even if it was a bit slower. |
@sphela02 problem may solved. at least my sentry didn't report anything about this for 4 hours. |
Was there any particular workaround applied? can you please share, if so. |
It was happening in Chrome Canary a few weeks ago, but I thought it was something related to that version |
@shravan20084312 it quick dirty fix so i just add this to main.ts
i grab this code from https://gist.github.com/lski/0eae0d2738831b6b0ec2b88a8a603952 |
As a workaround, we are seeing this to resolve the issue for now, until we get a stable fix from Angular/chrome. |
I麓m using this as a workaround from https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
It looks like @shravan20084312 might have done it more elegantly than us (s*he checks Chome version), but here's what we did. We created this as a polyfill, and we're including it with our other polyfills.
|
did this work as well @rodolfojnn |
We've used the smaller version... // TODO: Remove when things are fixed upstream (or in the browser?).
// Workaround for Angular issue: https://github.com/angular/angular/issues/35219
// and underlying Chromium bug:https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
(function () {
const arrayReduce = Array.prototype.reduce;
let callback;
Object.defineProperty(Array.prototype, 'reduce', {
value: function (cb, ...args) {
callback = cb;
return arrayReduce.call(this, callback, ...args);
}
});
})(); ...and included it in |
Same answer as @rodolfojnn |
Have same issue on my Angular8 app. After including this to
it fixes problem locally. But I still have it in prod build( |
@Nikitikitavi That should fix it in production too, at least it did for us, and given the general chatter around the issue it did so too for others I believe. Are you sure it's landing on your prod environment properly? |
Also note that the Chromium team made this "priority 0" in the abovementiond Chromium bug 1049982. As I write this it seems the fixes have landed in Chrome Canary already, and if I understand that thread correctly they're also aiming to patch Chrome 80. So the Angular team might not need to do anything (except for perhaps leaving this issue open for visibility, until the Chromium patch has landed properly in Chrome and Edge)... |
Yeah, I even found this code in my main-es2015.hash.js bundle file |
@Nikitikitavi i think user still use cached version or use version that before patched becuase browser already loaded before you deploy new version. so you need to find a way to make user refresh that page |
#35349 landed, so we'll have a new Angular patch version that we can use that does not rely on |
A new chrome update, version 80.0.3987.106, seems to solve the issue. |
Closing, as v9.0.1 includes a fix, and the latest Chrome release does not have the underlying issue anymore. |
Is a patch is planned on Angular 7.X version ? |
No, it will not be fixed in earlier versions #35349 (comment) |
@TheoLechemia Since Chrome 80.0.3987.106 the bug has been eliminated. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
馃悶 bug report
sometime form .get return null. i have no idea why?
for example in my code i just add
withholdingTax.items
in to form and i try to subscribe valueChanges but it said i try to access valueChanges of null valueAfter i try to find a re-produce step to fix it i found that sometime
form.get
will return null. as you can see in next screenshot line 195 and 199 is same code (console.log(this.form.get('withholdingTax.items'));
and not touch any controls in the form but result is differentlist of error that i found
Cannot read property 'controls' of null
Cannot read property 'valueChanges' of null
Cannot read property 'setValue' of null
Cannot read property 'value' of null
Cannot find control with name
Cannot read property 'length' of null
(FormArray)Affected Package
i think it should be
@angular/forms
Description
A clear and concise description of the problem...馃實 Your Environment
Anything else relevant?
i think this is browser specific issue. my issue tracker said this issue appear on
i am not sure is this same issue with #35214 or not
The text was updated successfully, but these errors were encountered: