Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor using @inherits breaks Component ("Found markup element with unexpected name"). #8800

Closed
TrieBr opened this issue Jun 2, 2023 · 2 comments

Comments

@TrieBr
Copy link

TrieBr commented Jun 2, 2023

Minimal Repro here:
https://github.com/TrieBr/blazorbug

I'm using dotnet 7.0.302.

When I add @inherits to a blazor component, that component no longer becomes recognized as a valid component.

Index.razor

@page "/"

<Bug>

</Bug>

<NotBug />

InheritMe.razor

<div />


@code {
    [Parameter]
    public int Param1 { get; set; }
}

Bug.razor

@inherits InheritMe

<div>
    
</div>

@code {

}

NotBug.razor

<div>
    
</div>

@code {

}

dotnet build:

Index.razor(3,1): warning RZ10012: Found markup element with unexpected name 'Bug'. If this is intended to be a component, add a @using directive for its namespace. [blazorbug.csproj]

Removing @inherits from Bug.razor fixes the issue.

Perhaps I'm using @inherit wrong, but there should be an error stating such. It's not clear why Bug is not recognized as a component.

@ScarletKuro
Copy link

Duplicate of dotnet/aspnetcore#48281

Also, please read this issue #8718

@chsienki
Copy link
Contributor

chsienki commented Jun 8, 2023

Closing as a dupe of #8718

@chsienki chsienki closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
@ghost ghost removed the untriaged label Jun 8, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants