question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor doesn't create component and create element instead

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I just came across this weird issue, that I havn’t seen this before.

<div class="lv-media-viewer-wrapper">
    <VideoMediaViewer Media="Media"
                      Size="Size"
                      OnNext="OnNext"
                      Loading="OnViewerLoading"
                      Loaded="OnViewerLoaded"
                      Stopped="Stopped"
                      AutoPlay="@AutoPlay"
                      StatusChanged="StatusChanged" />
</div>

The above Razor content doesn’t render properly, and generates a plain HTML tag instead:

<div class="lv-media-viewer-wrapper">
<videomediaviewer media="Media" size="Size" onnext="OnNext" loading="OnViewerLoading" loaded="OnViewerLoaded" stopped="Stopped" statuschanged="StatusChanged"></videomediaviewer>
</div>

VideoMediaViewer, and it’s parent component are in same namespace. I also checked compiled code, other components are recognized (using OpenComponent)

TypeInference.CreateCascadingValue_0<MediaPlayer>(__builder2, 10, 11, this, 12, true, 13, new RenderFragment(this, (RenderTreeBuilder __builder3) => {
                        __builder3.OpenElement(14, "div");
                        __builder3.OpenComponent<LvPanel>(15);
                        __builder3.AddAttribute(16, "Collapsed", RuntimeHelpers.TypeCheck<bool>(true));
                        __builder3.AddAttribute(17, "ChildContent", new RenderFragment(this, (RenderTreeBuilder __builder4) => {
                            __builder4.OpenComponent<RecordingMetaData>(18);
                            __builder4.AddAttribute(19, "Recording", RuntimeHelpers.TypeCheck<Recording>(this.Store.Recording));
                            __builder4.AddAttribute(20, "RecordingDetails", RuntimeHelpers.TypeCheck<RecordingDetails>(this.Store.RecordingDetails));
                            __builder4.CloseComponent();
                        }));
                        __builder3.CloseComponent();
                        __builder3.AddMarkupContent(21, "\r\n                    ");
                        __builder3.OpenElement(22, "div");
                        __builder3.AddAttribute(23, "class", "lv-media-viewer-wrapper");
                        __builder3.OpenElement(24, "VideoMediaViewer");
                        __builder3.AddAttribute(25, "Media", "Media");
                        __builder3.AddAttribute(26, "Size", "Size");
                        __builder3.AddAttribute(27, "OnNext", "OnNext");
                        __builder3.AddAttribute(28, "Loading", "OnViewerLoading");
                        __builder3.AddAttribute(29, "Loaded", "OnViewerLoaded");
                        __builder3.AddAttribute(30, "Stopped", "Stopped");
                        __builder3.AddAttribute(31, "AutoPlay", this.AutoPlay);
                        __builder3.AddAttribute(32, "StatusChanged", "StatusChanged");
                        __builder3.CloseElement();
                        __builder3.CloseElement();
                        __builder3.CloseElement();
                    }));

Expected Behavior

VideoMediaViewer should be rendered as a Blazor component

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

7.0

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 3 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
333fredcommented, Jun 12, 2023

@danroth27 yes, this looks like a dup. Verified that it does not repro on the next servicing release: image

0reactions
msftbot[bot]commented, Jun 12, 2023

To learn more about what this message means, what to expect next, and how this issue will be handled you can read our Triage Process document. We’re moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. Because it’s not immediately obvious what is causing this behavior, we would like to keep this around to collect more feedback, which can later help us determine how to handle this. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it’s very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor doesn't create component and create element instead
I just came across this weird issue, that I havn't seen this before. <div class="lv-media-viewer-wrapper"> <VideoMediaViewer Media="Media" Size= ...
Read more >
Blazor .NET doesn't render a component. It just displays as ...
I found the reason for this weird behaviour: Visual Studio sometimes doesn't set the build action type to "Content" on creating a new...
Read more >
ASP.NET Core Razor components
Learn how to create and use Razor components in Blazor apps, including guidance on Razor syntax, component naming, namespaces, and component ...
Read more >
Passing HTML element references
We identify which member in our component will hold a reference to the HTML element by creating a member with the type ElementReference...
Read more >
Blazor Developers Can Now Create Custom Elements ...
Experimental support to create custom Blazor elements comes via the Microsoft.AspNetCore.Components.CustomElements NuGet package, though it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found