angular 5 预期有 0​​ 个参数,但得到 1 个

标签 angular jhipster

我有一个 jhipster 项目。它在开发模式下运行良好。当我尝试在生产模式下构建时(使用命令“mvnw -Pprod”),出现错误:

ERROR in src\main\webapp\app\entities\ext-task\ext-task-group-list\ext-task-group-list.component.html(1,457): : Expected 0 arguments, but got 1. src\main\webapp\app\entities\ext-task\ext-task-group-list\ext-task-group-list.component.html(1,665): : Expected 0 arguments, but got 1. src\main\webapp\app\entities\ext-task\ext-task-list-template\ext-task-list-template.component.html(1,302): : Expected 0 arguments, but got 1. src\main\webapp\app\entities\ext-task\ext-task-list-template\ext-task-list-template.component.html(1,505): : Expected 0 arguments, but got 1.

所有 4 个错误都指向第 1 行,该行是空的。

为了找到实际的行号,我尝试了以下 cmd(在 so 中找到)。

yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www

同样的错误。

如何找到错误行号? mvnw 中是否有可用的调试选项来显示更多信息?如何解决这个错误?

最佳答案

好的,如果你正在使用 tree shaking,例如。使用 --aot,尤其是在构建时,它会检查模板中的函数。

此错误表明在您的模板 template.component.html 中,它调用了一个不带参数的函数,但您在其后放置了一个函数,例如。 打开(真)

您应该能够找到源代码。它应该位于 src\main\webapp\app\entities\ext-task\ext-task-group-list\ext-task-group-list.component.html 中,搜索任何调用的函数在此模板内。

关于angular 5 预期有 0​​ 个参数,但得到 1 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49130988/

相关文章:

mysql - Jhipster:如何使用字段而不是 id 创建关系

angular - JHipster 自定义错误消息翻译

heroku - 如何使用 Jhipster、Docker、Gitlab 和 Heroku 构建、测试和部署

Angular 2 无法解析服务的所有参数

jhipster - 使用 Git 存储库配置 jhipster-registry v3.0.3

angular - 使用 .NET core 2 为 Angular 6 启用 SSR

Angular 10 - 无法加载模块脚本 : The server responded with a non-JavaScript MIME type of "text/html"

java - JHipster - 在 build.gradle 中放置附加模块/插件的位置

angularjs - Angular NgUpgrade 将 AngularJS 服务注入(inject) Angular 服务;获取 : Unhandled Promise rejection: Cannot read property 'get' of undefined ; Zone:

angular - 仅运行一次 Angular 更改检测并停止检测该组件的更改