Open Closed

Getting a ResetLeptonXToolbar error on every page load in Blazor WASM 7.4 project #5955


User avatar
0
okains created
  • ABP Framework version: v7.4
  • UI Type: Blazor WASM
  • Database System: EF Core (SQL Server )
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

I am getting this error on every page load, on a brand new ABP Suite generated 7.4 WASM project. I have created 2 projects not in order to reproduce the error, and it is also being thrown in the 2nd project. No modifications at all to the projects were made after generation. I did choose the PWA option. Any ideas on how to get past this?

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: leptonx.init.initializers[5] is not a function TypeError: leptonx.init.initializers[5] is not a function at window.resetLeptonXToolbar (https://localhost:44391/global.js?_v=638326479317270084:51:2299) at https://localhost:44391/global.js?_v=638326479317270084:1:3337 at new Promise (<anonymous>) at Object.beginInvokeJSFromDotNet (https://localhost:44391/global.js?_v=638326479317270084:1:3311) at Object.Gt [as invokeJSFromDotNet] (https://localhost:44391/global.js?_v=638326479317270084:1:62569) at Object.Ii (https://localhost:44391/_framework/dotnet.7.0.12.cd75lmyo37.js:5:71974) at _mono_wasm_invoke_js_blazor (https://localhost:44391/_framework/dotnet.7.0.12.cd75lmyo37.js:14:103886) at wasm://wasm/00993936:wasm-function[313]:0x1d6b8 at wasm://wasm/00993936:wasm-function[283]:0x1cae6 at wasm://wasm/00993936:wasm-function[221]:0xe1d6 Microsoft.JSInterop.JSException: leptonx.init.initializers[5] is not a function TypeError: leptonx.init.initializers[5] is not a function at window.resetLeptonXToolbar (https://localhost:44391/global.js?_v=638326479317270084:51:2299) at https://localhost:44391/global.js?_v=638326479317270084:1:3337 at new Promise (<anonymous>) at Object.beginInvokeJSFromDotNet (https://localhost:44391/global.js?_v=638326479317270084:1:3311) at Object.Gt [as invokeJSFromDotNet] (https://localhost:44391/global.js?_v=638326479317270084:1:62569) at Object.Ii (https://localhost:44391/_framework/dotnet.7.0.12.cd75lmyo37.js:5:71974) at _mono_wasm_invoke_js_blazor (https://localhost:44391/_framework/dotnet.7.0.12.cd75lmyo37.js:14:103886) at wasm://wasm/00993936:wasm-function[313]:0x1d6b8 at wasm://wasm/00993936:wasm-function[283]:0x1cae6 at wasm://wasm/00993936:wasm-function[221]:0xe1d6 at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__16`1[[Microsoft.JSInterop.Infrastructure.IJSVoidResult, Microsoft.JSInterop, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) at Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXTheme.Components.ApplicationLayout.SideMenu.Navigation.MobileWasmNavbar.SetMenuAndProfileAsync() at Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.SideMenu.Navigation.MobileNavbar.OnInitializedAsync() at Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXTheme.Components.ApplicationLayout.SideMenu.Navigation.MobileWasmNavbar.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)


16 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello okains,

    This issue will be fixed in next release.

    Your ticket will be refunded.

    Thank you for reporting the issue.

    Regards, Anjali

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    After we publish please try and run

    abp clean & dotnet restore or build or run

    then it will work.

    best,

  • User Avatar
    0
    okains created

    OK great, thanks Anjali. Any idea of when the next release will be?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    We have released a patch release for LeptonXToolBar issue. To fix the error in your current project, first perform abp clean or dotnet clean on your current project. Then you need to run the abp bundle command in the Blazor project. please check now its working fine.

    Thanks, Anjali

  • User Avatar
    0
    okains created

    Hi,

    Thanks for getting back to me so quickly. Can't seem to get this to work though, I am not familiar with the abp bundle command so probably doing something wrong. Just cleaned my solution in VStudio and ran abp clean in the blazor project. Ran abp bundle as you suggested and got this error:

    Any ideas?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello okains,

    Please follow the below steps -

    1. Go to your main solution and open cmd then hit the commands
        abp clean // or dotnet clean
        dotnet restore
    
    1. Go to Blazor solution and open cmd then hit command
    abp bundle
    
    1. Build the project, run Backend i.e. Host and then run the Blazor solution.

    Thanks, Anjali

  • User Avatar
    0
    okains created

    Hi,

    I did exactly as you said. However when running abp bundle after clean / restore I get the same error noted above, i.e. cannot find my project assembly. So, I rebuild, then run abp bundle and everything works fine.

    However still the same issue when loading the WASM project. Are we missing a step here?

  • User Avatar
    0
    okains created

    Hi Anjali,

    Any update on this? I just saw the 7.4-patch Milestone but I can't seem to find this issue documented there. If there is another way to fix this, or if I am missing a step with your instructions above please let me know, I need to demo this soon and this bug is preventing me from doing so.

    Thanks,

    Karim

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello okains,

    I apologize for the delayed response.

    By using the steps listed above, I was able to reproduce the problem and resolve it.

    I don't exactly understand your situation either.

    Please try to delete node_modules folder from Host project and run yarn command. And then repeat the previous steps.

    Regards.

  • User Avatar
    0
    okains created

    Hi Anjali,

    I have followed your previous steps multiple times, they do not resolve the problem. I am sure that we are missing a step here.

    This is a Blazor WASM project, I don't see a node_modules folder. I did run yarn and npm but they didn't do much. The repeated the previous steps, and got the same result.

    You mentioned earlier that you have released a patch release to fix this:

    We have released a patch release for LeptonXToolBar issue.

    You haven't told me how to get this patch release, is this the step that we are missing here? I see that you are working on a 7.4 Patch release, is the actual fix for this in there?

    Thanks,

    Karim

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello Karim,

    I know your project is a Blazor WASM project, but your Host project must be having node_modules and yarn.lock file. You can delete that yarn.lock file instead of node_modules folder and run yarn command in cmd of Host project.

    1. Goto main solution and open CMD ; hit command dotnet clean
    2. after that hit command dotnet restore
    3. goto Blazor project open cmd and hit commandabp bundle
    4. after that goto Host project open cmd and hit command dotnet build and then dotnet run
    5. same as above for Blazor project also and then your project will run.

    Even if this doesn't help you try to update Leptonx version. Please check if any error occurs while firing above commands.

    Regards,

  • User Avatar
    0
    okains created

    Hi Anjali,

    OK I am following these steps exactly as above but still getting the same result.

    First of all to confirm, when you refer to the Host project, I am assuming that you mean the HttpApi.Host project? In my case ESv2.HttpApi.Host ( screenshot below ) ?

    Second, after a dotnet clean / restore if I run abp bundle on the Blazor project I get an error as noted in a previous message on this chain. So I need to build the Blazor project first, then I can run abp bundle without any issues.

    Other than that I am doing everything exactly as stated and getting the same error. The only other thing that I can think of that I have not used before is the PWA support, could that have anything to do with this?

  • User Avatar
    0
    okains created

    Even if this doesn't help you try to update Leptonx version.

    Looks up to date here, version 2.40

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi Anjali,

    OK I am following these steps exactly as above but still getting the same result.

    First of all to confirm, when you refer to the Host project, I am assuming that you mean the HttpApi.Host project? In my case ESv2.HttpApi.Host ( screenshot below ) ?

    Second, after a dotnet clean / restore if I run abp bundle on the Blazor project I get an error as noted in a previous message on this chain. So I need to build the Blazor project first, then I can run abp bundle without any issues.

    1. -> your host file is correct
    2. -> you need to run commands at cmd of main solution not in Blazor application in your case it may be
    • first run command dotnet clean
      then second command dotnet restore then third open Blazor project cmd and hit command abp bundle

    if still you are getting error after abp bundle please check once whether you are getting that first error after running Blazor application or not?

    I guess it should get resolved.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Even if this doesn't help you try to update Leptonx version.

    Looks up to date here, version 2.40

    Can you make sure you restore the v2.4.1 version of LeptonX packages.

    And then make sure you updated your bundles with abp bundle command in Blazor project

  • User Avatar
    0
    okains created

    Hi Anjali,

    Upgrading to 2.4.1 and bundle / clear cache etc worked. Thanks for your help!

    Karim

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11