Description
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 8.1
Versions.
Please run
ng --version
. If there's nothing outputted, please run in a Terminal:node --version
and paste the result here:
angular-cli: 1.0.0-beta.26
node: 6.9.5
os: win32 x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Added a new route in a working module:
const routes: Routes = [
{path: 'travesses', component: TravessesComponent},
{path: 'peres', component: TravessesComponent} <= this is the new one
];
The log given by the failure.
Normally this include a stack trace and some more information.
webpack: Compiling...
Hash: 1cb8464dd62798771354
Time: 476ms
chunk {0} main.bundle.js, main.bundle.map (main) 11.4 kB {2} [initial] [rendered]
chunk {1} styles.bundle.js, styles.bundle.map (styles) 9.96 kB {3} [initial]
chunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 3.16 MB [initial]
chunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
webpack: Compiled successfully.
Accessing the route gets:
EXCEPTION: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'peres'
Error: Cannot match any routes. URL Segment: 'peres'
at ApplyRedirects.noMatchError (http://localhost:4200/vendor.bundle.js:85516:16) [angular]
at CatchSubscriber.selector (http://localhost:4200/vendor.bundle.js:85485:29) [angular]
at CatchSubscriber.error (http://localhost:4200/vendor.bundle.js:68724:31) [angular]
at MapSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at MapSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at MapSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at MapSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at MapSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at MapSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at LastSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at LastSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at MergeAllSubscriber.OuterSubscriber.notifyError (http://localhost:4200/vendor.bundle.js:48223:26) [angular]
at InnerSubscriber._error (http://localhost:4200/vendor.bundle.js:91572:21) [angular]
at InnerSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
Mention any other details that might be useful.
After stopping ng serve and launching it again the route works as expected.
Thanks! We'll be in touch soon.