Extension completely breaks when an Angular project is not the root directory of a workspace.
See original GitHub issueš bug report
Is this a regression?
Not as far as I can tell.
Description
While working with the ASP.NET Angular template, I noticed that VS Code constantly throws errors about bad syntax, missing imports, and, helpfully, things like saying āAppears in the NgModule.imports of AppServerModule, but itself has errors(-996002)ā, but then proceeding to show no other errors in the file (example in screenshots).
The Angular app compiles just fine, and these errors go away if I open the Angular app as the workspace directory.
Iāve also been unable to reproduce this all of my machines; the problem seems to be sporadic but persistent. Iāve also been unable to reproduce it in any other situations; it doesnāt seem to occur when I create a nested directory inside an empty directory and then open an Angular project in that nested directory.
Bug Type
What does this bug affect
- Angular Language Service VSCode extension
- Angular Language Service server
Reproduction
Steps to reproduce the behavior:
- Clone this repository: https://github.com/b4ux1t3/angular-extension-test.git
git clone https://github.com/b4ux1t3/angular-extension-test.git
- Run
npm install
inside theClientApp
directory. - See the aforementioned errors.
Expected behavior
The extension should work regardless of where the angular project is within the VS Code workspace.
Logs
Iām unable to generate logs, because the Angular compiler itself works just fine; it has no problem compiling and serving the application Iām developing.
Screenshots
The aforementioned error.
ngForm apparently doesnāt exist for forms, but you can see in the previous screenshot that I am, indeed, properly importing the FormsModule
.
This is a rather large screenshot, but you can see the broken extension on the left, with the same file pulled up in a VSCode instance with the angular application set as the workspace root, and the running, compiled application with no console errors on the right.
This is essentially the āsmoking gunā that shows that the extension is the only thing misbehaving here.
š Your Environment
Angular Version:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ ā³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 12.0.0
Node: 14.16.1
Package Manager: npm 7.20.5
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1200.0 (cli-only)
@angular-devkit/core 12.0.0 (cli-only)
@angular-devkit/schematics 12.0.0 (cli-only)
@schematics/angular 12.0.0 (cli-only)
Extension Version:
v12.2.0
VSCode Version:
Version: 1.59.0 (user setup)
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:13:12.822Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Windows_NT x64 10.0.19043
Operating System:
Windows 10 Version 21H1 (OS Build 19043.1165)
Anything else relevant? Since I am running this as the client for a .NET application, VSCode is running (at least) three language servers:
- OmniSharp for C# and .NET
- Angular Language Service
- TypeScript
I donāt think that should matter, though.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top GitHub Comments
UPDATE: I upgraded the Angular version to 12.2.2, both in the application Iām working on and the test project I pushed.
This seems to have resolved the issue, apologies for the false alarm! Iām going to go open an issue on the .NET repo to get them to ship a supported version of Angular in their templates.
Thanks for the help @atscott!
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.