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.

fix: FluentMenu broken in published release build

See original GitHub issue

🐛 Bug Report

I have a basic FluentMenu.

image

On local development build everything works great. On a published release build clicking the FluentMenuItem causes an exception. There are no other warnings or exceptions visible in dev tools.

blazor.webassembly.js:1 
        
       Uncaught (in promise) Error: System.InvalidOperationException: There was an error parsing the event arguments. EventId: '8'.
 ---> System.NotSupportedException: DeserializeNoConstructor, JsonConstructorAttribute, Microsoft.Fast.Components.FluentUI.MenuChangeEventArgs Path: $ | LineNumber: 0 | BytePositionInLine: 1.
 ---> System.NotSupportedException: DeserializeNoConstructor, JsonConstructorAttribute, Microsoft.Fast.Components.FluentUI.MenuChangeEventArgs
   Exception_EndOfInnerExceptionStack
   at System.Text.Json.ThrowHelper.ThrowNotSupportedException(ReadStack& , Utf8JsonReader& , NotSupportedException )
   at System.Text.Json.ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(Type , Utf8JsonReader& , ReadStack& )
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1[[Microsoft.Fast.Components.FluentUI.MenuChangeEventArgs, Microsoft.Fast.Components.FluentUI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]].OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , MenuChangeEventArgs& )
   at System.Text.Json.Serialization.JsonConverter`1[[Microsoft.Fast.Components.FluentUI.MenuChangeEventArgs, Microsoft.Fast.Components.FluentUI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]].TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , MenuChangeEventArgs& )
   at System.Text.Json.Serialization.JsonConverter`1[[Microsoft.Fast.Components.FluentUI.MenuChangeEventArgs, Microsoft.Fast.Components.FluentUI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& )
   at System.Text.Json.Serialization.JsonConverter`1[[Microsoft.Fast.Components.FluentUI.MenuChangeEventArgs, Microsoft.Fast.Components.FluentUI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCoreAsObject(Utf8JsonReader& , JsonSerializerOptions , ReadStack& )
   at System.Text.Json.JsonSerializer.ReadFromSpan[Object](ReadOnlySpan`1 , JsonTypeInfo , Nullable`1 )
   at System.Text.Json.JsonSerializer.ReadFromSpan[Object](ReadOnlySpan`1 , JsonTypeInfo )
   at System.Text.Json.JsonSerializer.Deserialize(String , Type , JsonSerializerOptions )
   at Microsoft.AspNetCore.Components.Web.WebEventData.ParseEventArgsJson(Renderer , JsonSerializerOptions , UInt64 , String , JsonElement )
   Exception_EndOfInnerExceptionStack
   at Microsoft.AspNetCore.Components.Web.WebEventData.ParseEventArgsJson(Renderer , JsonSerializerOptions , UInt64 , String , JsonElement )
   at Microsoft.AspNetCore.Components.Web.WebEventData.Parse(Renderer , JsonSerializerOptions , WebEventDescriptor , JsonElement )
   at Microsoft.AspNetCore.Components.Web.WebEventData.Parse(Renderer , JsonSerializerOptions , JsonElement , JsonElement )
   at Microsoft.AspNetCore.Components.RenderTree.WebRenderer.WebRendererInteropMethods.DispatchEventAsync(JsonElement eventDescriptor, JsonElement eventArgs)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime , DotNetInvocationInfo& , IDotNetObjectReference , String )
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(JSRuntime , DotNetInvocationInfo , String )
    at Object.endInvokeDotNetFromJS (**************/_framework/blazor.webassembly.js:1:3549)
    at Object.Xt [as endInvokeDotNetFromJS] (**************/_framework/blazor.webassembly.js:1:63231)
    at Object.Gt [as invokeJSFromDotNet] (**************/_framework/blazor.webassembly.js:1:62728)
    at Object.Ii (**************/_framework/dotnet.7.0.1.16jbry1adl.js:5:71465)
    at _mono_wasm_invoke_js_blazor (**************/_framework/dotnet.7.0.1.16jbry1adl.js:14:103886)
    at wasm://wasm/00992aee:wasm-function[313]:0x1d4d6
    at wasm://wasm/00992aee:wasm-function[283]:0x1c904
    at wasm://wasm/00992aee:wasm-function[221]:0xdff4
    at wasm://wasm/00992aee:wasm-function[220]:0xce93
    at wasm://wasm/00992aee:wasm-function[8113]:0x1a215b


endInvokeDotNetFromJS	@	blazor.webassembly.js:1
Xt	@	blazor.webassembly.js:1
Gt	@	blazor.webassembly.js:1
Ii	@	dotnet.7.0.1.16jbry1adl.js:5
_mono_wasm_invoke_js_blazor	@	dotnet.7.0.1.16jbry1adl.js:14
$func313	@	00992aee:0x1d4d6
$func283	@	00992aee:0x1c904
$func221	@	00992aee:0xdff4
$func220	@	00992aee:0xce93
$func8113	@	00992aee:0x1a215b
$func2054	@	00992aee:0x85bb8
$func2059	@	00992aee:0x86220
$func2086	@	00992aee:0x882df
$mono_wasm_invoke_method_ref	@	00992aee:0x9bcf
Module._mono_wasm_invoke_method_ref	@	dotnet.7.0.1.16jbry1adl.js:14
_Microsoft_AspNetCore_Components_WebAssembly__Microsoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_BeginInvokeDotNet	@	_Microsoft_AspNetCor…eginInvokeDotNet:29
beginInvokeDotNetFromJS	@	blazor.webassembly.js:1
b	@	blazor.webassembly.js:1
invokeMethodAsync	@	blazor.webassembly.js:1
(anonymous)	@	blazor.webassembly.js:1
invokeWhenHeapUnlocked	@	blazor.webassembly.js:1
S	@	blazor.webassembly.js:1
A	@	blazor.webassembly.js:1
dispatchGlobalEventToAllElements	@	blazor.webassembly.js:1
(anonymous)	@	blazor.webassembly.js:1
onGlobalEvent	@	blazor.webassembly.js:1
emit	@	web-components.min.js:1
$emit	@	web-components.min.js:1
invoke	@	web-components.min.js:21
handleMenuItemClick	@	web-components.min.js:21
(anonymous)	@	web-components.min.js:183
handleEvent

That’s all the info I have at this point. I can try to come up with minimal repro in few days.

💻 Repro or Code Sample

🤔 Expected Behavior

😯 Current Behavior

💁 Possible Solution

🔦 Context

🌍 Your Environment

<PackageReference Include="Microsoft.Fast.Components.FluentUI" Version="2.0.0-rc-2" />

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:30

github_iconTop GitHub Comments

1reaction
vnbaaijcommented, Feb 21, 2023

This is added for FluentSwitch in version 2.1 which will be released in the coming days

1reaction
vnbaaijcommented, Jan 4, 2023

Ok, applying the same trick with the attribute on the DesignToken constructor resolved the error in the minimal repo. Please test again with this package

Read more comments on GitHub >

github_iconTop Results From Across the Web

FluentMenu broken in published release build · Issue #280 ...
On a published release build clicking the FluentMenuItem causes an exception. There are no other warnings or exceptions visible in dev tools.
Read more >
how to fix `You are deubbging a release build of ...
1) Right-click on both projects--> Properties --> Build --> Advanced --> Debugging information and set it to full. · 2) Click delete all ......
Read more >
What's new in the Microsoft Fluent UI library for Blazor ...
With this version, a fix has been implemented that enables these jumps to work as expected. This is being used heavily in the...
Read more >
Common Problems When Creating a Release Build
Heap layout will be the cause of about ninety percent of the apparent problems when an application works in debug, but not release....
Read more >
Release 1.0.1 Diederik van der Boor
The fluent_dashboard module offers a custom admin dashboard, built on top of django-admin-tools (code). The django-admin-tools package provides a default ...
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