Skip to content

[Hot Reload] Source Generator Based Error Breaks Hot Reload #36825

Closed
@TanayParikh

Description

@TanayParikh
Screen.Recording.2021-09-21.at.8.09.03.PM.mov

Repro:

Start with:

<input type="text" @bind-value="@SomethingWithoutASetter" placeholder="Title">

@code {
    public string SomethingWithoutASetter { get; } = string.Empty;
}

This doesn't give any error in VSCode, but it does give the source generator error:

/Users/tanay/dev/NoteTakingSample2/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Pages_Card_razor.g.cs(250,136): error CS0200: Property or indexer 'Card.SomethingWithoutASetter' cannot be assigned to -- it is read only [/Users/tanay/dev/NoteTakingSample2/NoteTakingSample2.csproj]

However, even after removing the offending <input> tag entirely the source generator error persists (perhaps it should've been marked as a rude edit?). Must exit dotnet watch and restart to resume functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyfeature-hot-reloadThis issue is related to the Hot Reload feaature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions