-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
RegisterCustomElement stopped working in Blazor 8 #53920
Comments
@rudibelt thanks for contacting us. Your sample doesn't setup Blazor Web correctly. As a starting point we suggest you start with a blank Blazor Web template with interactivity to begin with and add the code to register the custom elements. |
Hi, I create a new Blazor Web App with WebAssembly Interactive rende mode. Added a component Counter and use it in an index.html for the custom CustomElement scenario. Please see https://github.com/rudibelt/BlazorAppCustomElementsNet8 for this sample and the steps I toke in the commits. The sample works when using blazor.webassembly.js but not for blazor.web.js |
We also encountered the same problem. |
Hi, I faced the same issue migrating from 7 to 8. The hint I found out which may be useful: to make Blazor Custom elements to work one should force Blazor to setup Web Socket connection with server part (in 7 it was always the case). To do this, one can either set |
Same problem here, I followed https://learn.microsoft.com/en-us/aspnet/core/blazor/components/js-spa-frameworks?view=aspnetcore-8.0
|
The reason this doesn't always work is because We should update our docs to not suggest using a "Blazor Web"-style app for scenarios utilizing custom elements. Instead, we should show how to set up custom element scenarios utilizing However, we should definitely consider adding full support in the future for custom elements and JS root components when using
@guardrex, could we update these docs to not reference "Blazor Web App" scenarios? It's best that developers stick to |
Is there an existing issue for this?
Describe the bug
I upgraded the solution as found in https://github.com/khalidabuhakmeh/BlazorCustomElementsSample to .NET 8. Now the customelement no longer loads. If I use the old blazor.webassembly.js the customelement loads.
Expected Behavior
I expect that the customelement is loaded.
see branch feature/net8 in repo https://github.com/rudibelt/BlazorCustomElementsSample
Steps To Reproduce
run the code in featre/net8. customelement is no longer loaded
Exceptions (if any)
No response
.NET Version
8.0.100
Anything else?
No response
The text was updated successfully, but these errors were encountered: