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.

MudExpansionPanel causes unhandled error

See original GitHub issue

This was reproduced with the following vanilla environement:

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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mikes-ghcommented, Mar 15, 2021

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.

0reactions
attig78commented, Mar 15, 2021

ok thanks, will take it up in the Discord channel. Thanks for the help.

Read more comments on GitHub >

github_iconTop 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 >

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