未处理的承诺拒绝:路线的配置无效' PlayerManagement / PlayerMain /:id /':redirectTo和组件不能一起使用

时间:2018-01-26 17:35:10

标签: javascript jquery angular angular2-routing angular5

更新1:

从路由中删除组件后,现在应用程序正在为其他组件运行,但是如果我们从浏览器中的另一个组件返回到该播放器组件,我将收到以下错误

VM30741:34 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'PlayerManagement'
    at resolvePromise (zone.js:418)
    at resolvePromise (zone.js:403)
    at zone.js:451
    at ZoneDelegate.invokeTask (zone.js:225)
    at Object.onInvokeTask (core.js:4943)
    at ZoneDelegate.invokeTask (zone.js:224)
    at Zone.runTask (zone.js:125)
    at drainMicroTaskQueue (zone.js:357)
    at HTMLAnchorElement.ZoneTask.invoke (zone.js:297)


TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at console.window.console.error (<anonymous>:36:101)
    at defaultErrorLogger (core.js:1659)
    at ErrorHandler.handleError (core.js:1720)
    at Object.next (core.js:5700)
    at SafeSubscriber.schedulerFn [as _next] (core.js:4538)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:239)
    at SafeSubscriber.next (Subscriber.js:186)
    at Subscriber._next (Subscriber.js:126)
    at Subscriber.next (Subscriber.js:90)
  • 我正在从角度2升级到角度5
  • 升级后我遇到了三个错误。
  • 我使用了以下链接并进行了更新,但仍然发生以下错误。
  • 我搜索了该错误,但无法找到任何内容
  • 任何想法如何解决它。
  • 如果你让我知道如何修理它会很棒...所以将来我会自己修理它
  • 下方提供代码段和package.json

app.routing.ts https://hastebin.com/ufetoxozon.js

的package.json https://hastebin.com/adatojuput.json

<!-- language-all: lang-or-tag-here -->


VM3365:34 Unhandled Promise rejection: Invalid configuration of route 'PlayerManagement/PlayerMain/:id/': redirectTo and component cannot be used together ; Zone: <root> ; Task: Promise.then ; Value: Error: Invalid configuration of route 'PlayerManagement/PlayerMain/:id/': redirectTo and component cannot be used together
    at validateNode (router.js:757)
    at validateConfig (router.js:729)
    at validateNode (router.js:779)
    at validateConfig (router.js:729)
    at validateNode (router.js:779)
    at validateConfig (router.js:729)
    at Router.resetConfig (router.js:4958)
    at new Router (router.js:4820)
    at setupRouter (router.js:7305)
    at _callFactory (core.js:11128) Error: Invalid configuration of route 'PlayerManagement/PlayerMain/:id/': redirectTo and component cannot be used together
    at validateNode (webpack:///./node_modules/@angular/router/esm5/router.js?:757:15)
    at validateConfig (webpack:///./node_modules/@angular/router/esm5/router.js?:729:9)
    at validateNode (webpack:///./node_modules/@angular/router/esm5/router.js?:779:9)
    at validateConfig (webpack:///./node_modules/@angular/router/esm5/router.js?:729:9)
    at validateNode (webpack:///./node_modules/@angular/router/esm5/router.js?:779:9)
    at validateConfig (webpack:///./node_modules/@angular/router/esm5/router.js?:729:9)
    at Router.resetConfig (webpack:///./node_modules/@angular/router/esm5/router.js?:4958:9)
    at new Router (webpack:///./node_modules/@angular/router/esm5/router.js?:4820:14)
    at setupRouter (webpack:///./node_modules/@angular/router/esm5/router.js?:7305:35)
    at _callFactory (webpack:///./node_modules/@angular/core/esm5/core.js?:11128:28)


Error: Uncaught (in promise): Error: Invalid configuration of route 'PlayerManagement/PlayerMain/:id/': redirectTo and component cannot be used together
    at resolvePromise (zone.js:418)
    at zone.js:454
    at ZoneDelegate.invokeTask (zone.js:225)
    at Zone.runTask (zone.js:125)
    at drainMicroTaskQueue (zone.js:357)
    at XMLHttpRequest.ZoneTask.invoke (zone.js:297)


VM3365:36 Uncaught TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at console.window.console.error (<anonymous>:36:101)
    at consoleError (zone.js:346)
    at _loop_1 (zone.js:371)
    at drainMicroTaskQueue (zone.js:375)
    at XMLHttpRequest.ZoneTask.invoke (zone.js:297)

0 个答案:

没有答案