Open tschaffter opened 5 years ago
This post suggests that installing @angular/language-service
solves the issue.
Simply adding it to the list of dependencies doesn't solve the problem.
On June 2017: "The Angular language service is intended to be used in AOT compliant applications. There are several limitations, beyond the one in this issue, that would prevent the language service from working in a non-AOT'able JIT application."
"angular2-template-loader cannot work with AOT either. And require not being allowed is why there is the angular2-template-loader, for auto-switching between JIT and AOT."
Our project uses angular2-template-loader
.
@TheRobBrennan I'm not very familiar with AOT besides what I read here: https://blog.nrwl.io/angular-is-aot-worth-it-8fa02eaf64d4. Do you have additional insight into this issue?
@tschaffter Hm I'm not familiar with AOT, either. This is interesting - definitely worth taking a look at once higher priority things are hammered out.
VSCode show a similar error for all our Angular components:
Our components do define
template
. It seems that it's because we load them usingrequire()
that triggers the error message.