Ich habe den folgenden Code, im Grunde ein Hauptrouter in app.js und ein Kind Router in Dashboard js. Immer wenn ich auf die Root-URL gehe, bekomme ich eine Warnung in der Browser-Konsole. Ich verstehe nicht, was das Problem hier ist, die Weiterleitung funktioniert sogar richtig und alles wird angezeigt, aber ich bekomme immer noch diese riesige Warnung, die mir sagt, dass etwas schief gelaufen ist. Was vermisse ich? Jede Hilfe wird geschätzt.Aurelia-Router mit Kind-Router zeigt Warnung
Browserkonsole Warnung
Warning: a promise was rejected with a non-error: [object Object]
at _buildNavigationPlan (http://localhost:9000/scripts/vendor-bundle.js:14942:22)
at BuildNavigationPlanStep.run (http://localhost:9000/scripts/vendor-bundle.js:14922:14)
at next (http://localhost:9000/scripts/vendor-bundle.js:14488:20)
at Pipeline.run (http://localhost:9000/scripts/vendor-bundle.js:14501:14)
at http://localhost:9000/scripts/vendor-bundle.js:16050:25
From previous event:
at AppRouter._dequeueInstruction (http://localhost:9000/scripts/vendor-bundle.js:16023:32)
at http://localhost:9000/scripts/vendor-bundle.js:16014:17
From previous event:
at AppRouter._queueInstruction (http://localhost:9000/scripts/vendor-bundle.js:16011:14)
at http://localhost:9000/scripts/vendor-bundle.js:15945:23
From previous event:
at AppRouter.loadUrl (http://localhost:9000/scripts/vendor-bundle.js:15944:53)
at BrowserHistory._loadUrl (http://localhost:9000/scripts/vendor-bundle.js:11474:55)
at BrowserHistory._checkUrl (http://localhost:9000/scripts/vendor-bundle.js:11467:14)
app.js
export class App {
configureRouter(config, router) {
this.router = router;
config.map([
{ route: '', redirect: 'dashboard' },
{ route: 'dashboard', name: 'dashboard', title: 'Dashboard', moduleId: 'views/dashboard', auth: true }
]);
}
}
app.html
<template>
<require from="material-design-lite/material.css"></require>
<router-view></router-view>
</template>
dashboard.js
export class Dashboard {
configureRouter(config, router) {
this.router = router;
config.map([
{ route: 'fairs', name: 'fairs', title: 'Messen', moduleId: 'views/fairs', nav: true },
{ route: '', redirect: 'fairs' }
]);
}
attached() {
componentHandler.upgradeAllRegistered();
}
}
dashboard.html
<template>
<router-view></router-view>
</template>
Könnte etwas in Ihrer angehängten 'dashboard.js' Methode fehlschlagen, was zu plätschernden Fehlern führt? – Andrew
Auch ohne angehängte Methoden bekomme ich den gleichen Fehler, es kommt definitiv von der Weiterleitung, denn nur wenn ich die/URL besuche, erscheint der Fehler, wenn ich die vollständige URL/das Dashboard/was auch immer besuche, keinen Fehler. – QuantumDream