Meteor + Angular2

Hi all,
I’m trying to make a simple app with typescript Angular and meteor (with autopublish on ^^). I tried to follow the setting of angular-meteor-base, but I installed all dependencies myself, as it’s a quite old repo where the libs have new versions available already.

I installed the following dependencies:

  "dependencies": {
    "@angular/common": "^9.1.3",
    "@angular/compiler": "^9.1.3",
    "@angular/forms": "^9.1.3",
    "@angular/platform-browser": "^9.1.3",
    "@angular/platform-browser-dynamic": "^9.1.3",
    "@babel/runtime": "^7.9.2",
    "core-js": "^3.6.5",
    "meteor-node-stubs": "^1.0.0",
    "meteor-rxjs": "^0.4.14",
    "rxjs": "^6.5.5",
    "simpl-schema": "^1.7.0",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^9.1.3",
    "@angular/core": "^9.1.3",
    "@angular/router": "^9.1.3",
    "@types/chai": "^4.2.11",
    "@types/meteor": "^1.4.45",
    "@types/mocha": "^7.0.2",
    "@types/sinon": "^9.0.0",
    "chai": "^4.2.0",
    "mocha": "^7.1.2",
    "puppeteer": "^3.0.1",
    "sinon": "^9.0.2",
    "typescript": "^3.8.3"
  }

and this is my main.ts:

import 'zone.js';
import 'core-js/proposals/reflect-metadata';
import { Meteor } from 'meteor/meteor';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './imports/app/app.module';

Meteor.startup(() => {
  if (Meteor.isProduction) { enableProdMode(); }
  platformBrowserDynamic().bootstrapModule(AppModule);
});

When I’m going to localhost:3000 to test the app, I see Chrome crashing, with no error in Meteor. Why is it happening? How to fix it? And, most importantly, how do I debug these issues for the future? It’s likely I’m doing something totally wrong here, as I’m new not only to Meteor but to web dev overall.

Thank you for your help!

Hit CTRL+SHIFT+I to open the chrome web console. Is there an error there?

from that console message it looks like you could be missing the jquery and agular node packages

maybe try

meteor npm install --save angular jquery

then rerun the

meteor

command and hopefully it all works :slight_smile:

Im am going to be working on updating this tutorial

Meteor

to use Angular 2 soon if you want to check back in a little bit :slight_smile:

1 Like

Thank you. After unsuccessfully trying to install these and many others today and yesterday, I decided to go for the working version with old dependencies.

Looking forward to the updated tutorial!