I've been working on a Blazor WebAssembly .NET6 project for a couple of years. I updated VS2022 recently to the latest 17.10.0(I was in the previous 16.9 before), and after that I'm having TS1109 all over the razor files, my partner also is getting the same errors.
@inject IUserService UserService
@inject NavigationManager NavManager
@inject IDialogService DialogService
...
It is showing TS errors all the time pointing to the first lines of the opened .razor files, which are the @using or @inject lines that have been there since the start of the project. It allows me to compile and run, but it annoys mee seeing all those errors
I don't know if somoeone else ver here has experienced the same problem, I've tried a few things and nothing helped. Thanks in advance, and let me know if you need more info.
Tried deleting cache, obj and bin folders. Reinstalling VS2022, and setting the error list to just compilation instead of Intellisense, that last option only hides the error, but also hide other errors that are not TS related. My partner with the same version and project, and without VS extensions/addons is having the same issue, so it might not be addon related
*Edit: It has been patched and fixed with the 17.10.2 update https://developercommunity.visualstudio.com/t/TS1109-TS-Expression-expected-error-in/10635769
I have managed to turn off the latest VS2022 17.10.1 Intellisense's TS1109 errors for .razor files by selecting “Only report diagnostics for files opened in the editor” checkbox located in Tools -> Options -> Text Editor -> JavaScript/TypeScript -> Project -> General
Based on a workaround posted in VS Dev community:
Workaround - Maria Solano [MSFT]
Hope this will work for you too - good luck!🤞
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With