question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular LS sometimes breaks with solution-style project configuration (used by NX)

See original GitHub issue

Description

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:

  1. If ‘p-tieredMenu’ is an Angular component, then verify that it is part of this module.
  2. 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:

  1. Create an nx project with angular and nest
  2. Add primeng to that project
  3. use primeng components in HTML templates (import them in the right modules)
  4. 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

image

🌍 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

2reactions
atscottcommented, Jul 14, 2021

This is fixed by #1447 and will be included in this week’s release (likely tomorrow, but could be later)

2reactions
m0rtyncommented, Jul 13, 2021

Same problem: NX with several tsconfigs + VSCode + NG12, but for MacOS.

It doesn’t always show up, but it’s annoying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The ultimate migration guide to angular-eslint, ESLint and Nx 11
Prerequisites; Setting up a new Nx Angular workspace with angular-eslint. Option 1: Use the empty workspace preset; Option 2: Use the ...
Read more >
Project Configuration - Nx
Projects can be configured in package.json (if you use npm scripts and not Nx executors) ... Nx merges the two files to get...
Read more >
customizable workspaces, Angular 10 support, Better WebStorm
Solution-style tsconfigs are a new feature of TypeScript that allows the IDE to use specific tsconfig files for references to different files. Previously,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found