0
votes

I have a Angular 2 app created and running on development computer (lets say PC1), no error and no issues. PC1 is where app got created using the Angular CLI.

But if I get the latest code from another development computer (lets say PC2). if I say ng serve I get bellow warning.

WARNING in ./~/@angular/router/src/router_module.js 303:51-71 "export 'LOCATION_INITIALIZED' was not found in '@angular/common' webpack: Compiled with warnings.

When I run it on the browser (Chrome), I get below error and app does not work.

zone.js:420 Unhandled Promise rejection: Token must be defined! ; Zone: ; Task: Promise.then ; Value: ZoneAwareError {__zone_symbol__error: Error: Token must be defined! at new ReflectiveKey (http://localhost:4200/vendor.bundle.js:47642…, __zone_symbol__stack: "Error: Token must be defined!↵ at new Reflectiv…calhost:4200/vendor.bundle.js:35600:37) [angular]", __zone_symbol__message: "Token must be defined!"} Error: Token must be defined! at new ReflectiveKey (http://localhost:4200/vendor.bundle.js:47642:19) [angular] at KeyRegistry.get (http://localhost:4200/vendor.bundle.js:47695:39) [angular] at Function.ReflectiveKey.get (http://localhost:4200/vendor.bundle.js:47660:35) [angular] at ReflectiveInjector_.get (http://localhost:4200/vendor.bundle.js:100568:102) [angular] at AppModuleInjector.NgModuleInjector.get (http://localhost:4200/vendor.bundle.js:65909:52) [angular] at RouterInitializer.appInitializer (http://localhost:4200/vendor.bundle.js:72616:48) [angular] at new ApplicationInitStatus (http://localhost:4200/vendor.bundle.js:45643:45) [angular] at AppModuleInjector.createInternal (/AppModule/module.ngfactory.js:483:36) [angular] at AppModuleInjector.NgModuleInjector.create (http://localhost:4200/vendor.bundle.js:65892:76) [angular] at NgModuleFactory.create (http://localhost:4200/vendor.bundle.js:65860:18) [angular] at http://localhost:4200/vendor.bundle.js:46066:61 [angular] at Object.onInvoke (http://localhost:4200/vendor.bundle.js:35600:37) [angular] zone.js:422 ZoneAwareError {__zone_symbol__error: Error: Uncaught (in promise): Error: Token must be defined! Error: Token must be defined! at new…, rejection: ZoneAwareError, promise: ZoneAwarePromise, zone: Zone, task: ZoneTask}

below is the screenshot of the errr

1
Check that you aren't using different versions of angular-cli, node, and npm. - Jim

1 Answers

0
votes

This error just started cropping up today for me when I upgraded an app to @[email protected] (while using @angular/[email protected].

Dropping back down to @[email protected] seems to have solved it.