angular7 轉場動畫 Error: Unable to process animations due to the following failed trigger transitions

這個錯誤是由項目首次打開時,enter/leave時找不到元素而報的一個錯誤。目前還沒找到解決辦法。但對運行還是無關緊要的。

ERROR Error: Unable to process animations due to the following failed trigger transitions
@routeAnimations has failed due to:

  • query(":leave") returned zero elements. (Use query(":leave", { optional: true }) if you wish to allow this.)

  • query(":leave") returned zero elements. (Use query(":leave", { optional: true }) if you wish to allow this.)

    at TransitionAnimationEngine.push…/node_modules/@angular/animations/fesm5/browser.js.TransitionAnimationEngine.reportError (vendor.js:4296)
    at TransitionAnimationEngine.push…/node_modules/@angular/animations/fesm5/browser.js.TransitionAnimationEngine._flushAnimations (vendor.js:4442)
    at TransitionAnimationEngine.push…/node_modules/@angular/animations/fesm5/browser.js.TransitionAnimationEngine.flush (vendor.js:4262)
    at InjectableAnimationEngine.push…/node_modules/@angular/animations/fesm5/browser.js.AnimationEngine.flush (vendor.js:5110)
    at vendor.js:133984
    at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.js:7430)
    at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.run (polyfills.js:7180)
    at NgZone.push…/node_modules/@angular/core/fesm5/core.js.NgZone.runOutsideAngular (vendor.js:79992)
    at AnimationRendererFactory.push…/node_modules/@angular/platform-browser/fesm5/animations.js.AnimationRendererFactory.end (vendor.js:133982)
    at DebugRendererFactory2.push…/node_modules/@angular/core/fesm5/core.js.DebugRendererFactory2.end (vendor.js:86674)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章