angular: bug(animations): Cannot read property insertNode of undefined

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Sorry my english is not good but I try my best to describe the problem.

Animation bug when views are removed/inserted quickly

Expected behavior

No error occur.

Minimal reproduction of the problem with instructions

https://github.com/sandangel/angular-bug.git

yarn yarn start

UPDATED: link stackblitz

https://stackblitz.com/edit/angular-dso7hm

Updated: Reproduce steps

1/ Click on table link, then then graph link will show up.

2/ Click on the ‘Graph’ link and when the chart have show up. Click on ‘refresh’ button on stackblitz preview (not browser refresh). And when stackblitz is bundling app (the text Bundling App is appearing), hit back button on mouse and the error will occur after bundling app is finish.

This time the error occur every time I try. Here is my hardware info

screen shot 2017-12-02 at 20 10 53

Update gif file to show reproduce step.

ezgif com-add-text

What is the motivation / use case for changing the behavior?

Environment


@angular/cli: 1.4.7
node: 8.7.0
os: darwin x64
@angular/animations: 4.4.5
@angular/cdk: 2.0.0-beta.12
@angular/common: 4.4.5
@angular/compiler: 4.4.5
@angular/core: 4.4.5
@angular/flex-layout: 2.0.0-beta.9
@angular/forms: 4.4.5
@angular/http: 4.4.5
@angular/material: 2.0.0-beta.12
@angular/platform-browser: 4.4.5
@angular/platform-browser-dynamic: 4.4.5
@angular/router: 4.4.5
@angular/cli: 1.4.7
@angular/compiler-cli: 4.4.5
@angular/language-service: 4.4.5
typescript: 2.5.3

this happens in angular 5.0.0-rc.2 too


Browser:
- [x] Chrome (desktop) version 62
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 8.7.0  
- Platform:   MacOS High Sierra, Linux Ubuntu 16.04

Others:

Actually I sent a pull request to fix this problem but seem like no one noticed it so I post an issue here. I just add

if (this._fetchNamespace(namespaceId)) {
    this._fetchNamespace(namespaceId).insertNode(element, parent);
}

and the bug has gone.

https://github.com/angular/angular/pull/19662

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Alright I was able to reproduce it 😃

Looks like a race condition, I got the error after several tries with chromium 62.

  1. click graph link
  2. reload page and while the app is bootstrapping hit back using my mouse (button is kinda freeze during reload) No need to go that fast.

Maybe some cpu throttling may make it easier to catch.