Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular: Running ngcc causing performance issues in VSCode

In my Visual Studio Code editor after last updates I see this text in the status bar:

enter image description here

Angular: Running ngcc for project d:/..../tsconfig.spec.json

It looks like frozen or do nothing a while, just spin the arrows.

Before this text I saw a similar one with tscfonfig.json ending...

Since this text is showing in the status my vscode has some performance issues... it became very-very slow. Sometimes, very often the quick import (ctrl-space) isn't work, not found classes, interfaces what before this update worked well.

What is this? Is it neccessary or can I switch off somehow? Is this maybe a plugin bug?

like image 471
netdjw Avatar asked Feb 19 '21 13:02

netdjw


People also ask

Is Visual Studio code good for Angular?

Using Angular in Visual Studio Code. Angular is a popular web development platform developed by Google. The Visual Studio Code editor supports Angular IntelliSense and code navigation out of the box.

What is Ngcc Angular?

ngcc (which stands for Angular compatibility compiler) is designed to process code coming from NPM and produce the equivalent Ivy version, as if the code was compiled with ngtsc .


2 Answers

I had the same issue. I had to turn off FullTemplateTypeCheck in the Angular Compiler Options.

Note: this issue has been resolved in version V11.2.3 of the Angular Language Service VS Code extension.

If you want to disable fullTemplateTypeCheck:

In your tsconfig.json file set "fullTemplateTypeCheck" to false and restart VS Code.

fullTemplateTypeCheck is in the angularCompilerOptions object in your tsconfig.json file.

Here is mine:

  "angularCompilerOptions": {
    "enableIvy": true,
    "fullTemplateTypeCheck": false    
  }

Update

If you upgrade the Angular Language Service VS Code Extension to V11.2.3. It looks like this problem has been resolved. See here.

I updated the extension to V11.2.3 and I have re-enabled fullTemplateTypeCheck and I can confirm it is working as expected.

like image 110
Donal Avatar answered Oct 19 '22 04:10

Donal


EDIT: They improved performance in Angular Language Service v11.2.3 release. In this version (or higher), you can re-enable Experimental-ivy feature, it's still slower but not as before, now at least it's usable (they said there is room for improvement).


If it got slow again, it's likely a known issue with the new Experimental-ivy feature from the Angular Language Service, they are working on a fix.

For now, you can temporarily disable it by opening the extension settings:

Manage Extensions UI

Then uncheck the Experimental-ivy feature:

Disable ivy

like image 31
Alisson Reinaldo Silva Avatar answered Oct 19 '22 02:10

Alisson Reinaldo Silva