angular/cli更新后导致路由跳转失败问题

作者: 阿踏 | 来源:发表于2018-04-05 02:15 被阅读178次

    今天打开项目时突然报了一个错,昨天还是好好的,一直提示路由懒加载错误,但是排除了各种情况都没发现问题,最后才发现是angular/cli的版本问题,真的是。。。,以下是错误

    ERROR Error: Uncaught (in promise): TypeError: __webpack_require__.e is not a function
    TypeError: __webpack_require__.e is not a function
        at webpackAsyncContext (eval at ./src/$$_lazy_route_resource lazy recursive (main.bundle.js:13), :15:29)
        at SystemJsNgModuleLoader.loadAndCompile (core.js:6554)
        at SystemJsNgModuleLoader.load (core.js:6538)
        at RouterConfigLoader.loadModuleFactory (router.js:4543)
        at RouterConfigLoader.load (router.js:4523)
        at MergeMapSubscriber.eval [as project] (router.js:2015)
        at MergeMapSubscriber._tryNext (mergeMap.js:128)
        at MergeMapSubscriber._next (mergeMap.js:118)
        at MergeMapSubscriber.Subscriber.next (Subscriber.js:92)
        at ScalarObservable._subscribe (ScalarObservable.js:51)
        at webpackAsyncContext (eval at ./src/$$_lazy_route_resource lazy recursive (main.bundle.js:13), :15:29)
        at SystemJsNgModuleLoader.loadAndCompile (core.js:6554)
        at SystemJsNgModuleLoader.load (core.js:6538)
        at RouterConfigLoader.loadModuleFactory (router.js:4543)
        at RouterConfigLoader.load (router.js:4523)
        at MergeMapSubscriber.eval [as project] (router.js:2015)
        at MergeMapSubscriber._tryNext (mergeMap.js:128)
        at MergeMapSubscriber._next (mergeMap.js:118)
        at MergeMapSubscriber.Subscriber.next (Subscriber.js:92)
        at ScalarObservable._subscribe (ScalarObservable.js:51)
        at resolvePromise (zone.js:809)
        at resolvePromise (zone.js:775)
        at eval (zone.js:858)
        at ZoneDelegate.invokeTask (zone.js:421)
        at Object.onInvokeTask (core.js:4736)
        at ZoneDelegate.invokeTask (zone.js:420)
        at Zone.runTask (zone.js:188)
        at drainMicroTaskQueue (zone.js:595)
        at ZoneTask.invokeTask [as invoke] (zone.js:500)
        at invokeTask (zone.js:1517)
    

    后来将@angular/cli@1.6.1提高到@angular/cli@1.7.3就解决了

    相关文章

      网友评论

      • Scarlettbiu:同遇到这个情况,但是我升级到1.7.3后还是报这个错:pensive:

      本文标题:angular/cli更新后导致路由跳转失败问题

      本文链接:https://www.haomeiwen.com/subject/xucrhftx.html