angular / vscode-ng-language-service

Angular extension for Visual Studio Code
MIT License
773 stars 116 forks source link

Problem with Angular V17 Flow Control #2033

Closed ArnaldoAlamos closed 4 months ago

ArnaldoAlamos commented 4 months ago

🐞 bug report

Is this a regression?

Maybe

Description

Hello, I created a new project with the version of angular 17, I was previously working on another project with angular 15 and the angular service extension in vscode without problems. When creating the new project, Angular v17's flow control gives me problems in the html files. It only happens to me with versions of angular language service > 17.0.0. ## Bug Type What does this bug affect

Reproduction

Create new angular project with VSCode lenguaje service extensiΓ³n > 17.0.0

Expected behavior

Let the new angular v17 flow control recognized in an html file.

Screenshots

With extension > 17.0.0

Incorrect

With extension = 17.0.0

Correct

🌍 Your Environment

Angular Version:



Angular CLI: 17.3.7
Node: 20.13.1
Package Manager: npm 10.5.2
OS: win32 x64

Angular: 17.3.8
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.7
@angular-devkit/build-angular   17.3.7
@angular-devkit/core            17.3.7
@angular-devkit/schematics      17.3.7
@angular/cli                    17.3.7
@schematics/angular             17.3.7
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.5

Extension Version:


17.3.2 || >17.0.0

VSCode Version:


Version: 1.89.1 (user setup)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.19045

Is this a bug with the extension or an environment configuration issue or something similar?

thank you

atscott commented 4 months ago

This seems likely to be an environment configuration issue. The problem appears to be that the control flow feature got turned off completely, likely as a result of trying to determine if the project is using a version that supports it.

Can you try clearing your node_modules and reinstalling dependencies? If that doesn't fix it, attaching the server logs and screenshot of the output would be helpful. I was not able to reproduce this issue myself.

image

A github repository that can reproduce the issue would also be necessary to get any further in investigations.

ArnaldoAlamos commented 4 months ago

Thanks for your answer ,

logserver

Honestly I'm not an expert, but maybe the item highlighted in red should be true? If so, where can I change that option? I tried to put it in the tsconfig.json file but it didn't work.

Another thing that catches my attention is that it indicates angular core v 16.2.9

atscott commented 4 months ago

Another thing that catches my attention is that it indicates angular core v 16.2.9

This is the version of angular that was found in the node modules and is why block syntax got disabled. Have you tried clearing the node_modules and reinstalling dependencies?

ArnaldoAlamos commented 4 months ago

Hello, I already tried to delete the node modules folder and reinstall, I also updated the dependencies but I have no results, I really don't know why Angular Lenguage Server takes that values, I tried to clean the npm cache and nothing... I don't know what else I could do..

If I change the angular core version and enableblock option in the tsconfig file, the following appears

tsconfig servverlog

It is as if the property were static in false

atscott commented 4 months ago

If I change the angular core version and enableblock option in the tsconfig file, the following appears

You cannot change those values yourself. They're determined programatically.

At this point, a repository that can be used to reproduce the problem will be needed to make any more progress.

ArnaldoAlamos commented 4 months ago

To solve it, do the following

1) update some dependencies

PD: It was probably just necessary to update some of the previous dependencies and then reopen vscode

After those steps the problem was corrected and the angular server log shows angular core v17.3.9

Correct

I really appreciate the help

greetings

angular-automatic-lock-bot[bot] commented 3 months ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.