我有一个jhipster项目。它在开发模式下运行良好。当我尝试构建生产模式(使用cmd“mvnw -Pprod”)时,我收到错误:
错误在src \ main \ webapp \ app \ entities \ ext-task \ ext-task-group-list \ ext-task-group-list.component.html(1,457)::预期的0个参数,但得到1. src \ main \ webapp \ app \ entities \ ext-task \ ext-task-group-list \ ext-task-group-list.component.html(1,665)::预期的0个参数,但得到1. src \ main \ webapp \ app \ entities \ ext-task \ ext-task-list-template \ ext-task-list-template.component.html(1,302)::预期0个参数,但得到1. src \ main \ webapp \ app \ entities \ ext-task \ ext-task-list-template \ ext-task-list-template.component.html(1,505)::预期的0个参数,但得到1。
所有4个错误都指向第1行,它是空的。
为了找到实际的行号,我尝试了下面的cmd(在so中找到)。得到了同样的错误。
纱线运行清理&&纱线运行webpack:prod:main &&纱线运行清洁www
如何找到错误行号? mvnw中是否有可用的调试选项来显示更多信息?如何解决此错误?
好的,如果你正在使用树摇,前。使用--aot
,特别是构建时间,它将检查模板中的功能。
这个错误表明在你的模板template.component.html
中,它调用一个没有参数的函数,但是你之后放了一个,ex。 open(true)
您应该能够找到源代码,它应该位于src\main\webapp\app\entities\ext-task\ext-task-group-list\ext-task-group-list.component.html
内,搜索此模板中调用的任何函数。