Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

intermitten bug: cannot read property '$$phase' of null #16583

Closed
1 of 3 tasks
stripathix opened this issue May 29, 2018 · 3 comments · Fixed by angular-indonesia/angular.js#145 or javascript-indonesias/angular.js#90
Closed
1 of 3 tasks

Comments

@stripathix
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • other

Current behavior:

It is a intermitten problem can't reporduce but It happend when I was switch state from dashbord to account

Expected / new behavior:

Minimal reproduction of the problem with instructions:

AngularJS version: 1.6.10

Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Anything else:

TypeError: Cannot read property '$$phase' of null
at $$debounceViewValueCommit(../app/node_modules/angular/angular.min.js:301:520)
at $setViewValue(../app/node_modules/angular/angular.min.js:301:207)
at call(../app/node_modules/angular/angular.min.js:184:85)
at lg(../app/node_modules/angular/angular.min.js:40:48)
at apply(../app/node_modules/angular/angular.min.js:39:497)
at HTMLInputElement.d(../app/node_modules/raven-js/dist/raven.min.js:2:4706)

@gkalpak
Copy link
Member

gkalpak commented May 29, 2018

It is hard to investigate without a reproduction 😞
Do you at least know which browsers are affected. (Could it be that this only happens on IE?)

  • The error seems to happen on this line, when $$scope.$root is null.
  • This happens when $$scope has been destroyed.
  • AFAICT, for the error to appear, $setViewValue() has to be called asynchronously and scope be destroyed between scheduling $setViewValue() and actually invoking it.
  • This can (only?) happen if the input listener is called asynchronously, which happens on browsers that do not support the input event (i.e. IE).

It sounds reasonable to add a check for $$scope.$$destroyed in $setViewValue() or $$debounceViewValueCommit(). But without a way to reproduce the issue, we can't be sure if it is actually fixing anything 😁

@gkalpak gkalpak self-assigned this May 29, 2018
@gkalpak gkalpak added this to the 1.7.x milestone May 29, 2018
@gkalpak
Copy link
Member

gkalpak commented May 29, 2018

@stripathix, if you feel like taking a stab at it, feel free to submit a pull request 😁
(Also feel free to ping me if you need any help/guidance/info.)

@stripathix
Copy link
Author

Below is the environment information:
Chrome Version: 66.0.3359
Windows 10

gkalpak added a commit to gkalpak/angular.js that referenced this issue May 30, 2018

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
This could for example happen if updating the value is debounced (either
by asynchronously calling `$setViewValue()` or via `ngModelOptions`).

Fixes angular#16583
gkalpak added a commit that referenced this issue May 31, 2018

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
This could for example happen if updating the value is debounced (either
by asynchronously calling `$setViewValue()` or via `ngModelOptions`).

Fixes #16583

Closes #16585
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.