Angular LS sometimes breaks with solution-style project configuration (used by NX)
See original GitHub issueDescription
I have an Nx project, using angular and nestjs. In this project, I’m using primeng components. Usually, when I simply have my angular project, outside of an nx project (this is my first time with nx) the extension works pretty well (vscode). Right now in that project, I encounter some errors in my HTML components, on primeng components (90% of the time) and autocompletion won’t work anymore for these (rarely and randomly it works well though, without me doing anything special). This only is an issue caused by this extension, in an nx environment. The project works and compiles pretty well though and this issue just shows errors that are not right, eg: ‘p-tieredMenu’ is not a known element:
- If ‘p-tieredMenu’ is an Angular component, then verify that it is part of this module.
- If ‘p-tieredMenu’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.ngtsc(-998001) (Even if I add the CUSTOM_ELEMENTS_SCHEMA, the problem remains)
That issue is so annoying!!
Bug Type
Wrong errors highlighted in xxxx.component.html files, on primeng components (never tried on other external components)
- Angular Language Service VSCode extension
- Angular Language Service server
Reproduction
Steps to reproduce the behavior:
- Create an nx project with angular and nest
- Add primeng to that project
- use primeng components in HTML templates (import them in the right modules)
- You may need to reload vscdoe to make this “errors” happen (unfortunately, this is a little random)
Expected behavior No fake errors highlighted and autocompletion working for these external components
Screenshots
🌍 Your Environment
Angular Version:
12.1.1
Extension Version:
12.1.1
VSCode Version:
1.58.0
Operating System:
Ubuntu 20.04.2 LTS
Anything else relevant? I tried removing all other extensions except for angular language service but the problem remains and I also tried to reload the angular language server more than once but it never fixed anything
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11
Top GitHub Comments
This is fixed by #1447 and will be included in this week’s release (likely tomorrow, but could be later)
Same problem: NX with several tsconfigs + VSCode + NG12, but for MacOS.
It doesn’t always show up, but it’s annoying.