模板编译'ea'时出错

时间:2018-01-18 00:45:03

标签: angular progressive-web-apps

编译我的角度

时遇到问题

模板编译'ɵa'时出错错误   装饰器不支持函数调用,但“注入”中调用了“ɵmakeDecorator”     '注射'调用'ɵmakeDecorator'。

我该如何解决此错误?

3 个答案:

答案 0 :(得分:2)

因此,在尝试将Angular从4.x更新为5.x时,我遇到了同样的问题。

这个问题与AOT编译有关,但是不要再问我了。我不能详细解释任何事情。

但是,请转到tsconfig.app.json并添加以下行:

"paths": { "@angular/*": ["../node_modules/@angular/*"] },

还要确保在同一文件中,模块设置为“es2015”。

希望这适合你!

答案 1 :(得分:1)

I would check any 3rd party tools you're using to make sure they don't have dev-dependencies on an older version of Angular.

I was seeing this same error when I updated Angular from 4.x to 5.x, and I later noticed that one of my 3rd party libraries was actually installing its own version of Angular 4.x as a dev-dependency.

Unfortunately in my case this library didn't have a newer version that supported Angular 5.x, so I had to switch it out.

答案 2 :(得分:0)

如果您在Angular项目之外导入文件,则会发生此错误。就我而言,我不小心从另一个项目中导入了一个具有相同名称的TypeScript文件。因此,请搜索诸如../..之类的可疑商品。