MudExpansionPanel causes unhandled error
See original GitHub issueThis was reproduced with the following vanilla environement:
- Using Visual Studio 2019, new Project and new Blazor WebAssembly project (.net 5).
- Follow manual Install steps as per https://mudblazor.com/getting-started/installation
I have tried all the examples from the expansion panel. For example the first one:
<MudExpansionPanels>
<MudExpansionPanel Text="Panel One" MaxHeight="150">
Panel One Content
</MudExpansionPanel>
<MudExpansionPanel Text="Panel Two" MaxHeight="500">
Panel Two Content
</MudExpansionPanel>
<MudExpansionPanel Text="Panel Three" MaxHeight="1000">
Panel Three Content
</MudExpansionPanel>
<MudExpansionPanel Text="Panel Four">
Panel Four Content
</MudExpansionPanel>
</MudExpansionPanels>
The panel renders but without the child content. This causes the following unhandled error in the browser. It works fine on TryMudBlazor.
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
Error: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
at https://localhost:44311/_framework/blazor.webassembly.js:1:1287
at Array.forEach (<anonymous>)
at e.findFunction (https://localhost:44311/_framework/blazor.webassembly.js:1:1247)
at b (https://localhost:44311/_framework/blazor.webassembly.js:1:2989)
at https://localhost:44311/_framework/blazor.webassembly.js:1:3935
at new Promise (<anonymous>)
at Object.beginInvokeJSFromDotNet (https://localhost:44311/_framework/blazor.webassembly.js:1:3908)
at Object.w [as invokeJSFromDotNet] (https://localhost:44311/_framework/blazor.webassembly.js:1:64232)
at _mono_wasm_invoke_js_blazor (https://localhost:44311/_framework/dotnet.5.0.4.js:1:190800)
at do_icall (<anonymous>:wasm-function[10596]:0x194e4e)
Microsoft.JSInterop.JSException: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
Error: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
at https://localhost:44311/_framework/blazor.webassembly.js:1:1287
at Array.forEach (<anonymous>)
at e.findFunction (https://localhost:44311/_framework/blazor.webassembly.js:1:1247)
at b (https://localhost:44311/_framework/blazor.webassembly.js:1:2989)
at https://localhost:44311/_framework/blazor.webassembly.js:1:3935
at new Promise (<anonymous>)
at Object.beginInvokeJSFromDotNet (https://localhost:44311/_framework/blazor.webassembly.js:1:3908)
at Object.w [as invokeJSFromDotNet] (https://localhost:44311/_framework/blazor.webassembly.js:1:64232)
at _mono_wasm_invoke_js_blazor (https://localhost:44311/_framework/dotnet.5.0.4.js:1:190800)
at do_icall (<anonymous>:wasm-function[10596]:0x194e4e)
at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__15`1[[MudBlazor.Interop.BoundingClientRect, MudBlazor, Version=5.0.5.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at MudBlazor.MudCollapse.UpdateHeight()
at MudBlazor.MudCollapse.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Data Grid
The <MudDataGrid> is used to display and work with small amounts of data up to very large datasets, easily and efficiently. In it's...
Read more >MudExpansionPanel - Not consistent in expansions #1316
When I have an Expansion Panel on a site with default behavior, I don't always click&expand panels in order they are presented to...
Read more >Getting error An unhandled exception has occurred. See ...
Hi I am working on Blazor server side and getting "An unhandled exception has occurred. See browser dev tools for details.
Read more >Expansion Panels
The panels inner collapsible won't expand until IsExpandedChanged has completed, enabling smooth opening of expansion panels even if the data is not loaded...
Read more >Unhandled Exceptions in Blazor Server with Error ...
When Blazor Server detects an unhandled exception from a component, ASP.NET Core treats it as a fatal exception. Why?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I suggest you ask your peers for support on the discord #help channel. You could also compare one of our working templates with your code to see what is causing the issue in your setup. We try and keep the github issues for bugs and enhancements.
ok thanks, will take it up in the Discord channel. Thanks for the help.