流星教程 - 未定义跟踪器

Meteor Tutorial - Tracker is not defined

我正在做 Meteor + Ionic 教程,在纠正了几个错误之后,我完全坚持了一个。

用这个

更改我的 main.ts 代码
import 'meteor-client';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 
import { MeteorObservable } from 'meteor-rxjs'; 
import { Meteor } from 'meteor/meteor'; 
import { AppModule } from './app.module';

Meteor.startup(() => {   
    const subscription = MeteorObservable.autorun().subscribe(() => {

        if (Meteor.loggingIn()) {
            return;
        }

        setTimeout(() => subscription.unsubscribe());
        platformBrowserDynamic().bootstrapModule(AppModule);   
    }); 
});

引发下一个错误

ReferenceError: Tracker is not defined at autorun (http://localhost:8100/build/vendor.js:178469:13) at Observable._subscribe (http://localhost:8100/build/vendor.js:178480:27) at Observable._trySubscribe (http://localhost:8100/build/vendor.js:23023:25) at Observable.subscribe (http://localhost:8100/build/vendor.js:23011:93) at http://localhost:8100/build/main.js:57:65 at maybeReady (http://localhost:8100/build/vendor.js:123856:57) at HTMLDocument.loadingCompleted (http://localhost:8100/build/vendor.js:123868:9) at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660) at r.runTask (http://localhost:8100/build/polyfills.js:3:10834) at e.invokeTask [as invoke] (http://localhost:8100/build/polyfills.js:3:16794)

我已经检查了所有的依赖项,一切正常

我的猜测是订阅没有直接连接到自动运行。尝试将两者分开:

 const sub = MeteorObservable.subscribe('mySubscriptionForSomeData');
    const autorun = MeteorObservable.autorun();
    Observable.merge(sub, autorun).subscribe(() => {
        this.jobs = SomeCollection.find().zone(); // Data is ready here
    }, (err) => {
        console.log(err); // error fetching data
    }, () => {
        console.log('This will print always, whether data is fetched or err happened');
    });

来源:https://github.com/Urigo/meteor-rxjs/issues/98

全新节点安装解决了问题