Angular2 - meteor pattern stops working after meteor update

I'm just looking at a Meteor Angular 2 tutorial. In step 6, I accidentally tried a “meteorite update” that broke my sample. The update works and the server starts. However, the browser screen remains blank and an error appears on the console. Since I am new to meteor, I can not understand the reason why?

The reboot in the browser ends with the following error message in the console:

Uncaught SyntaxError: Unexpected token < Uncaught (in promise) Uncaught SyntaxError: Unexpected token < Evaluating http://localhost:3000/client/app.js Error loading http://localhost:3000/client/app.js 

Update command line console:

 meteor update This project is already at Meteor 1.2.1, the latest release. Changes to your project package version selections from updating package versions: barbatus:angular2 upgraded from 0.6.6 to 0.7.3 barbatus:ng2-compilers upgraded from 0.1.0 to 0.1.1 barbatus:ts-compilers upgraded from 0.1.8 to 0.1.9_5 barbatus:typescript upgraded from 0.1.3 to 0.1.3_3 urigo:angular2-meteor upgraded from 0.2.5 to 0.3.5 

Restart meteor:

 meteor => Started proxy. => Started MongoDB. ***** New typings have been added ***** | typings/angular2/core.d.ts typings/angular2/common.d.ts typings/angular2/bootstrap.d.ts typings/angular2/platform/browser.d.ts typings/es6-promise/es6-promise.d.ts typings/es6-shim/es6-shim.d.ts ***** Please re-start your app ***** meteor => Started proxy. => Started MongoDB. => Started your app. => App running at: http://localhost:3000/ 
+5
source share
1 answer

Angular2 has changed, and you will need to import specific packages for each dependency. The Angular2 Meteor tutorial has been deprecated. I'm not sure which packages should be imported in order to do step 6, but as an example, Step 0 Boot will work with the following change:

In the app.ts application, change the line:

 import {Component, View, bootstrap} from 'angular2/angular2'; 

in

 import {bootstrap} from 'angular2/platform/browser' import {Component, View} from 'angular2/core'; 

In addition, there are several updates for the tutorial here.

Hope this helps.

UPDATE: I found out that http://ng-meteor.meteor.com/tutorials/angular2/ is deprecated. Instead, I recommend that you follow http://www.angular-meteor.com/tutorials/socially/angular2/ .

+7
source

Source: https://habr.com/ru/post/1239375/


All Articles