I recently attempted to update my project to version 2.0.0-rc.1, but encountered this Exception that I cannot seem to resolve. After running ng serve, there are no errors reported, yet in the dist folder /vendor/@angular/router-deprecated directory exists. Any insights on what I might be overlooking?
"http://localhost:4200/vendor/@angular/router-deprecated Failed to load resource: the server responded with a status of 404 (Not Found)
zone.js:461 Unhandled Promise rejection: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/@angular/router-deprecated
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:4200/vendor/zone.js/dist/zone.js:769:30)
at ZoneDelegate.invokeTask (http://localhost:4200/vendor/zone.js/dist/zone.js:356:38)
at Zone.runTask (http://localhost:4200/vendor/zone.js/dist/zone.js:256:48)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:423:34)
Error loading http://localhost:4200/vendor/@angular/router-deprecated as "@angular/router-deprecated" from http://localhost:4200/app/account.js ; Zone: <root> ; Task: Promise.then ; Value: Error: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/@angular/router-deprecated(…)consoleError @ zone.js:461
zone.js:463 Error: Uncaught (in promise): Error: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/@angular/router-deprecated(…)consoleError @ zone.js:463
http://localhost:4200/vendor/@angular/router-deprecated Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:4200/traceur Failed to load resource: the server responded with a status of 404 (Not Found)"
Below is the section where routing takes place:
import {Component, provide, Optional, Inject, NgZone} from '@angular/core';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router-deprecated';
/*import {CliRouteConfig} from './route-config';*/
import {BgtPulseRegisterSimple} from './register-simple/register-simple';
import {BgtPulseLogin} from './login/login';
@Component({
selector: 'account-app',
providers: [
ROUTER_PROVIDERS,
provide('UserService', { useClass: UserService }),
provide('NotificationService', { useClass: NotificationServiceMock }),
provide('RoutingService', { useClass: RoutingServiceMock })
],
template: `
<h2>Account</h2>
<nav>
<a [routerLink]="['Login']" class="nav-login">Login</a>
<a [routerLink]="['RegisterSimple']" class="nav-register-simple">Register Simple</a>
</nav>
<hr>
<div style="margin:20px; border:1px solid #ccc;">
<router-outlet></router-outlet>
</div>
`,
directives: [ROUTER_DIRECTIVES, RegisterSimple, FormElements],
pipes: []
})
@RouteConfig([
{ path: '/login', name: 'Login', component: Login },
{ path: '/register-simple', name: 'RegisterSimple', component: RegisterSimple }
])
export class AccountApp {
private userStore: any;
private userState: any = null;
constructor(
private ngZone: NgZone,
@Optional() @Inject('UserStore') UserStore: any
) {
let userData = {
general: {
userNodeID: 123,
username: 'Max.m',
firstname: 'Max',
lastname: 'Mustermann',
salutation: 'Mr',
birthdate: '23.12.1988'
},
address: {
street: 'Musterstraße',
houseNumber: '4',
postCode: '4020',
city: 'Linz',
countryCode: 'AT'
},
contact: {
phone: '0123456789',
email: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc919d84bc91889hn89ewnt90dkw0dpncbjdpq">[email protected]</a>',
newsletter: true
},
payment: {
accountHolderName: 'Max Mustermann',
bic: 'AT65232323',
iban: 'AT9837272727272'
},
culture: {
currency: 'EUR',
language: 'de',
oddFormat: 'Decimal'
}
}
this.userStore = UserStore;
this.ngZone.runOutsideAngular(() => {
this.ngZone.run(() => {
this.userStore.dispatch({ type: 'USER_LOGIN', data: userData });
});
});
}
}