Error After Upgrading the Blazor Project WASM to .Net 8 to .Net 9

Satyasai Gunnam 40 Reputation points
2024-12-24T05:47:54.8166667+00:00

I got this errors While Upgrading my Blazor Web assembly Project to .Net 8 to .Net 9

Error
Message=   Source=   Stack Trace:   at

https://localhost:7123/_framework/dotnet.runtime.o8gq1i8bk6.js:3:96088

This Error  I got in console

MONO_WASM: instantiate_wasm_module() failed TypeError: Cannot read properties of undefined (reading 'promise')

 

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,635 questions
0 comments No comments
{count} votes

Accepted answer
  1. JasonPan - MSFT 6,096 Reputation points Microsoft Vendor
    2024-12-24T07:31:11.2366667+00:00

    Hi @Satyasai Gunnam

    When upgrading from .NET8 to .NET9, we not only need to adjust the Target framework, but also upgrade all packages to latest version.

    User's image

    For me, I upgraded below packages.

    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
    

    You need to check it in Nuget Package Manager tool.

    User's image


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Jason

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.