razor icon indicating copy to clipboard operation
razor copied to clipboard

blazor after visual studio update throws some strange warnings

Open d00lar opened this issue 5 months ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

after update visual studio to 17.11.3 in some componentsthat i open VS throw some warning as

Severity	Code	Description	Project	File	Line	Suppression State
Warning (active)	TS1109	(JS) Expression expected.	Miscellaneous	D:\xxx\Components\Core\DialogConfirmComponent.razor__virtual.html__virtual.js	9	

as on screen enter image description here

the issue is with this:

OnClick="@(async () => await Validate())"> or OnClick="Validate"

i causing this isssue

@onclick="@(async () => await Validate())"> or @onclick="Validate"

this one do not throws the warning

but BOTH should be correct and not throw any warning as OnClick is valid APi call on mudblazor button https://mudblazor.com/api/button#properties

please fix that in visual studio - the error should be different / maybe pointing into correct line at least... ?

why this was valid in older versions ? why it shows the exception now ?

before update there was no such things...?

Expected Behavior

-it should not throw this warning -doubleclick sould take to error line?

Steps To Reproduce

Minimal Reproducible Example

  1. Have 17.11.3 Visual Studio
  2. Dotnet new install MudBlazor.Templates
  3. New project - MudBlazor Web APP (server rendering mode / global)
  4. Open counter component. delete all.
  5. Paste into this counter component
<MudButton Variant="Variant.Filled" Color="Color.Primary"  OnClick="@(()=>blabla())">Validate</MudButton>
@code {

  public void blabla()
   {
        
   }

}
  1. Save and see the warning

Exceptions (if any)

(JS) expression expected.

.NET Version

8.0.400

d00lar avatar Sep 17 '24 07:09 d00lar