【发布时间】:2019-12-21 10:29:55
【问题描述】:
当我尝试在生产模式下构建我的 Angular (8.2.2) 应用程序时,它会引发以下错误:
ERROR in Error during template compile of 'Compiler'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Injectable'
'Injectable' calls 'ɵmakeDecorator'.
我已经尝试返回我知道以前可以运行的代码版本,但由于某种原因,它们都抛出了这个错误。它发生在我的开发机器和 CircleCI 上,因此它似乎无法通过删除 node_modules 和包锁来修复。
我似乎无法在网上找到有关此特定错误的任何信息,因为大多数类似的错误都与 Angular 库有关。非常感谢任何帮助
【问题讨论】:
-
在您的项目中搜索
@Injectable装饰器。您是否有任何复杂的@Injectable装饰器要向其中传递值? -
@Noremac 我所有的 @Injectable 装饰器要么是标准的 @Injectable({ providedIn: 'root' }) 要么只是 @Injectable()
-
U 可能是从基类派生的,并在 base.service.ts 上留下了 @Injectable 装饰器
-
@Sagat,我确实有一个基础服务,它也是可注入的,但在过去的 8 个月里一直没有问题。 Angular 中的某些内容最近是否发生了更改,不再允许这样做?
标签: angular build angular-cli circleci