I got this problem: (Error: Could not find 'Blazor._internal.attachRootComponentToElement' ('attachRootComponentToElement' was undefined).)

0 Answers 93 Views
Miscellaneous
Miguel
Top achievements
Rank 1
Miguel asked on 11 Jul 2024, 04:01 AM

I´m working in a blazor wasm hosted app, i had problems with posting on IIS so searching solutions, I installed de nugget packet: Microsoft.NETCore.App.Runtime.Mono.browse-wasm, then it seems to be incompatible with something and I unistalled, then the app stop working and bring me this error:

VM11 blazor.webassembly.js:1 Error: One or more errors occurred. (Error: Could not find 'Blazor._internal.attachRootComponentToElement' ('attachRootComponentToElement' was undefined).) at Jn (marshal-to-js.ts:349:18) at Tl (marshal-to-js.ts:306:28) at 00b21cf6:0x1fad7 at 00b21cf6:0x1bf9f at 00b21cf6:0xf16c at 00b21cf6:0x1e7f1 at 00b21cf6:0x1efe7 at 00b21cf6:0xcfbc at 00b21cf6:0x44213 at e.<computed> (cwraps.ts:338:24)

 

the project si call Risk.

This is my Risk.Server.csproject:

<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <PackageReference Include="AutoMapper" Version="12.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.3.1" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Client\Risk.Client.csproj" /> <ProjectReference Include="..\Shared\Risk.Shared.csproj" /> </ItemGroup> </Project>

and this is my index.html:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>Risk</title>
    <base href="/" />
    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="css/app.css" rel="stylesheet" />
    <link href="Risk.Client.styles.css" rel="stylesheet" />
    <link rel="stylesheet" href="_content/Radzen.Blazor/css/software-base.css">
</head>

<body>
    <div id="app">Loading...</div>

    <div id="blazor-error-ui">
        An unhandled error has occurred.
        <a href="" class="reload">Reload</a>
        <a class="dismiss">🗙</a>
    </div>
    <script src="_framework/blazor.webassembly.js"></script>
    <script src="_framework/blazor.webassembly.js" autostart="false"></script>
    <script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script>
        window.downloadFile = async (fileName, byteArray) => {
            const blob = new Blob([new Uint8Array(byteArray)]);
            const arrayBuffer = await blob.arrayBuffer();
            const url = URL.createObjectURL(blob);
            const anchorElement = document.createElement('a');
            anchorElement.href = url;
            anchorElement.download = fileName ?? '';
            anchorElement.click();
            anchorElement.remove();
            URL.revokeObjectURL(url);
        }
    </script>


</body>

</html>
can someone help for this error, thanks.

 

 

 

No answers yet. Maybe you can help?

Tags
Miscellaneous
Asked by
Miguel
Top achievements
Rank 1
Share this question
or