razor
razor copied to clipboard
blazor after visual studio update throws some strange warnings
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
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
- Have 17.11.3 Visual Studio
- Dotnet new install MudBlazor.Templates
- New project - MudBlazor Web APP (server rendering mode / global)
- Open counter component. delete all.
- Paste into this counter component
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(()=>blabla())">Validate</MudButton>
@code {
public void blabla()
{
}
}
- Save and see the warning
Exceptions (if any)
(JS) expression expected.
.NET Version
8.0.400