Angular2 和 Heroku AOT 构建 - 提供的参数与调用目标的签名不匹配

Angular2 and Heroku AOT build - Supplied parameters do not match signature of call target

我的 Angular2 应用程序已经构建、编译并且 运行 好几个月了。 package.json 也几个月没变了。

今天,当我部署到 Heroku 时,我突然遇到了一大堆以前从未见过的错误。

例如:

ERROR in /tmp/build_2370f712cb3c370be2ee07c793ee7c1e/src/$$_gendir/app/products
/product-form/product-form.component.ngfactory.ts (93,9): 
 Supplied parameters do not match any signature of call target.

我不知道它指的是实际组件中的哪一行。此代码在几天前工作并构建。

我联系了 Heroku 支持,他们不知道为什么突然开始发生这种情况。

来看,好像和AOT编译有关。但我认为 Heroku 总是那样做。这里有点迷糊。

如果我在本地强制使用 ng build --aot --prod none 进行 AOT 编译,则会发生这些错误。

请注意,错误是指 'ngfactory.ts' 文件的第 93 行 - 那么我如何才能找到组件中的实际行号?

编辑

我创建了一个全新的项目,将所有内容更新到 Angular 4.1.3。每次我添加一个新组件时,我都会推送到 Heroku。一切都很好(到目前为止大约 30 个组件)直到最新的组件,它现在给出相同的错误除了它不是指 ngFactory.ts 文件,而是指 html 文件!

ERROR in ng:///tmp/build_48fd9e2da47f9df65e24dab60d5fc080/src/app/
proposal-list/proposal-list.component.html (8,7): 
Supplied parameters do not match any signature of call target.

这是文件,第 8 行是结尾 </pagination-controls>。这毫无意义 - 它指的是什么提供的参数?!

<div class="row fb-pager-row">
  <div class="col-md-4 text-left fb-pager-records">
    {{total$ | async | i18nPlural:pluralizeMapQuote}}
  </div>
  <div class="col-md-8 text-right">
    <pagination-controls class="fb-pager" autoHide="true"
      (pageChange)="goToPage($event)" id="server" previousLabel="Prev" maxSize="7">
    </pagination-controls>
  </div>
</div>
<div class="list-group">
  <fb-proposal-list-item *ngFor="let proposal of items$ | async | 
     paginate: { id: 'server', itemsPerPage: 10, currentPage: currentPage, totalItems: total$ | async }" 
    [proposal]="proposal" (proposalDataChanged)="handleDataChanged($event)">
  </fb-proposal-list-item>
</div>

如果我完全删除分页控件,它就会生成。所以我假设这个 third party control.

中有些东西很无聊

所以是第7行有问题,不是第8行

我终于明白了:

(pageChange)="goToPage($event)"

有2个参数,没有一个。所以

(pageChange)="goToPage($event, true)"

修正错误。