TypeError:无法读取null的属性“ onChildOutletCreated”

时间:2020-09-24 15:16:18

标签: angular angular-router

我具有以下构建配置,以生成导致以下错误的角度构建。

{
              "fileReplacements": [
   {
    "replace": "src/environments/environment.ts",
    "with": "src/environments/environment.qa.ts"
   }
  ],
  "baseHref": "./",
  "optimization": true,
  "sourceMap": true,
  "namedChunks": false,
  "aot": true,
  "extractLicenses": true,
  "vendorChunk": false,
  "buildOptimizer": false
}

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'onChildOutletCreated' of null
TypeError: Cannot read property 'onChildOutletCreated' of null
    at new e (main.js?v=2.3.2.c657756:sourcemap:1)
    at main.js?v=2.3.2.c657756:sourcemap:1
    at Ao (main.js?v=2.3.2.c657756:sourcemap:1)
    at main.js?v=2.3.2.c657756:sourcemap:1
    at new e (main.js?v=2.3.2.c657756:sourcemap:1)
    at Object.$o [as createNgModuleRef] (main.js?v=2.3.2.c657756:sourcemap:1)
    at t.create (main.js?v=2.3.2.c657756:sourcemap:1)
    at t.project (main.js?v=2.3.2.c657756:sourcemap:1)
    at t._next (main.js?v=2.3.2.c657756:sourcemap:1)
    at t.next (main.js?v=2.3.2.c657756:sourcemap:1)
    at T (zone.js.pre-build-optimizer.js:831)
    at T (zone.js.pre-build-optimizer.js:788)
    at zone.js.pre-build-optimizer.js:892
    at t.invokeTask (zone.js.pre-build-optimizer.js:423)
    at Object.onInvokeTask (main.js?v=2.3.2.c657756:sourcemap:1)
    at t.invokeTask (zone.js.pre-build-optimizer.js:422)
    at e.runTask (zone.js.pre-build-optimizer.js:195)
    at m (zone.js.pre-build-optimizer.js:601)

在使用以下功能登录后将用户导航到仪表板时,我遇到了以上错误。 令人讨厌的是,它在本地无法重现,并且在普通浏览器上运行良好,而在隐身模式下,它却失败了,但是,某些用户也在普通浏览器上遇到了此错误,我已经完成了缓存清理的强制重载,仍然无法正常工作,请帮助。

navigateToPage(paramRole) {
    switch (paramRole) {
        case 'verifyEmail': {
            this._router.navigate(['/verify-email']);
            break;
        }
        case 'verifyPhone': {
            this._router.navigate(['/verify-phone']);
            break;
        }
        default: {
            this._router.navigate(['/dashboard']);
        }
    }
}

TypeError:无法读取null的属性“ onChildOutletCreated”

0 个答案:

没有答案