0

我有一个 Angular Meteor 项目正在运行。它正在运行,但是由于某种原因,在我尝试更新所有软件包(不起作用)之后,我在编译时遇到了以下错误。

client/imports/app/team/team-edit.component.ts (104, 33): Type 'Meteor.User[]' is not assignable to type 'User[]'. 
client/imports/app/team/team-edit.component.ts (161, 13): Type 'Meteor.User' is not assignable to type 'User'.

我的用户界面如下所示:

export interface User extends Meteor.User {
  _id?: string;
  profile?: {
    name: string;
  }
}

还有我的收藏:

export const Users = MongoObservable.fromExisting(Meteor.users);
if (Meteor.isClient) {
  Meteor.subscribe("users");
}

我的组件中的用法:

users: Observable<User[]>;

this.users = Users.find({});

该错误从未出现,但现在确实出现了,我不知道为什么以及发生了什么变化。希望有人知道如何解决这个问题:)

流星版本:1.9.3

 "dependencies": {
    "@angular/animations": "^7.2.15",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "^7.2.15",
    "@angular/compiler": "^7.2.15",
    "@angular/core": "^7.2.15",
    "@angular/forms": "^7.2.15",
    "@angular/http": "^7.2.15",
    "@angular/material": "^7.2.15",
    "@angular/platform-browser": "^7.2.15",
    "@angular/platform-browser-dynamic": "^7.2.15",
    "@angular/platform-server": "^7.2.15",
    "@angular/router": "^7.2.15",
    "@babel/runtime": "^7.4.5",
    "@ng-bootstrap/ng-bootstrap": "^4.2.2",
    "@types/lodash": "^4.14.134",
    "angular-date-value-accessor": "0.0.2",
    "bcrypt": "^3.0.8",
    "bootstrap": "^4.1.3",
    "core-js": "^2.6.9",
    "fontawesome": "^4.7.2",
    "har-validator": "^5.1.3",
    "jquery": "^3.4.1",
    "lodash": "^4.17.10",
    "meteor-node-stubs": "~0.3.3",
    "meteor-rxjs": "^0.4.14",
    "ngx-ckeditor": "^0.3.2",
    "popper.js": "^1.15.0",
    "rpg-awesome": "^0.2.0",
    "rxjs": "^6.5.2",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.11.0",
    "@angular/cli": "^7.3.9",
    "@angular/compiler-cli": "^7.2.15",
    "@types/chai": "^4.1.3",
    "@types/meteor": "^1.4.28",
    "@types/mocha": "^2.2.44",
    "@types/node": "^11.13.14",
    "@types/sinon": "^4.3.1",
    "chai": "^4.1.2",
    "less": "^3.9.0",
    "node-sass": "^4.14.1",
    "phantomjs-prebuilt": "^2.1.16",
    "raw-loader": "^0.5.1",
    "sass-loader": "^7.0.3",
    "sinon": "^4.5.0",
    "typescript": "^3.5.2"
  }
4

0 回答 0