dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.18k stars 4.72k forks source link

Simple Blazor Webassembly project not working in .net8 RC1 #92587

Closed andivlad-talentia closed 1 year ago

andivlad-talentia commented 1 year ago

Description

Started a new Blazor Webassembly project and it doesn't seem to work, an exception is thrown in the browser: image

Reproduction Steps

  1. Simply start a new Blazor Webassembly project from Visual Studio Preview Version 17.8.0 Preview 2.0.
  2. Build & Run
  3. Error is shown in the console of chrome

Expected behavior

Test website should be shown

Actual behavior

Blazor application loader executes but fails when starting

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

ghost commented 1 year ago

Tagging subscribers to this area: @thaystg See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Started a new Blazor Webassembly project and it doesn't seem to work, an exception is thrown in the browser: ![image](https://github.com/dotnet/runtime/assets/67757358/e8af405a-04d2-4186-92a3-b16a4dffdfe5) ### Reproduction Steps 1. Simply start a new Blazor Webassembly project from Visual Studio Preview Version 17.8.0 Preview 2.0. 2. Build & Run 3. Error is shown in the console of chrome ### Expected behavior Test website should be shown ### Actual behavior Blazor application loader executes but fails when starting ### Regression? _No response_ ### Known Workarounds _No response_ ### Configuration _No response_ ### Other information _No response_
Author: andivlad-talentia
Assignees: -
Labels: `untriaged`, `area-Debugger-mono`
Milestone: -
ghost commented 1 year ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Started a new Blazor Webassembly project and it doesn't seem to work, an exception is thrown in the browser: ![image](https://github.com/dotnet/runtime/assets/67757358/e8af405a-04d2-4186-92a3-b16a4dffdfe5) ### Reproduction Steps 1. Simply start a new Blazor Webassembly project from Visual Studio Preview Version 17.8.0 Preview 2.0. 2. Build & Run 3. Error is shown in the console of chrome ### Expected behavior Test website should be shown ### Actual behavior Blazor application loader executes but fails when starting ### Regression? _No response_ ### Known Workarounds _No response_ ### Configuration _No response_ ### Other information _No response_
Author: andivlad-talentia
Assignees: -
Labels: `arch-wasm`, `untriaged`, `area-Debugger-mono`
Milestone: -
radical commented 1 year ago

The errors have:

Screenshot 2023-09-25 at 10 54 52

@pavelsavara @maraf could this be the simd-not-supported on the browser issue?

ShreyasJejurkar commented 1 year ago

If this is a valid issue, I wondered if didn't it catch up in the unit test!?🤔

radical commented 1 year ago

What version of chrome are you running this with?

andivlad-talentia commented 1 year ago

Version 116.0.5845.188 (Official Build) (64-bit) & Version 117.0.5938.92 (Official Build) (64-bit) Also tested on Firefox: 117.0.1 (64-bit)

Issue reproduces on all

pavelsavara commented 1 year ago

This is src\mono\mono\mini\interp\interp.c 3629

image

I think this is not simd issue.

ghost commented 1 year ago

Tagging subscribers to this area: @brzvlad, @kotlarmilos See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Started a new Blazor Webassembly project and it doesn't seem to work, an exception is thrown in the browser: ![image](https://github.com/dotnet/runtime/assets/67757358/e8af405a-04d2-4186-92a3-b16a4dffdfe5) ### Reproduction Steps 1. Simply start a new Blazor Webassembly project from Visual Studio Preview Version 17.8.0 Preview 2.0. 2. Build & Run 3. Error is shown in the console of chrome ### Expected behavior Test website should be shown ### Actual behavior Blazor application loader executes but fails when starting ### Regression? _No response_ ### Known Workarounds _No response_ ### Configuration _No response_ ### Other information _No response_
Author: andivlad-talentia
Assignees: -
Labels: `arch-wasm`, `untriaged`, `area-Codegen-Interpreter-mono`, `area-VM-meta-mono`
Milestone: -
radical commented 1 year ago

That line is different in rc1 vs main. https://github.com/dotnet/runtime/blob/f52a29561c30ccd7475e40a4fb56928738a6eac2/src/mono/mono/mini/interp/interp.c#L3625-L3631

.. which was probably called from https://github.com/dotnet/runtime/blob/f52a29561c30ccd7475e40a4fb56928738a6eac2/src/mono/mono/mini/interp/interp.c#L7783-L7786 (that's the only call use of that function that I found).

@kg @BrzVlad @vargaz

vargaz commented 1 year ago

Can somebody reproduce this ?

radical commented 1 year ago

I wasn't able to reproduce this with VS 17.8 Preview 3.0 (OP used 2.0), which seems to be using the same rc1 version.

@andivlad-talentia Could you please share how to reproduce this?

  1. Is this with a default template project? Any changes made to the project?
  2. How are you building, and running the app?
  3. Can you also share the output of dotnet --info from command line?
  4. Are you able to reproduce this from the command line, starting with no existing bin, and obj directories? If you, then can you please add /bl to that, and share the generated msbuild.binlog?
ghost commented 1 year ago

This issue has been marked needs-author-action and may be missing some important information.

BrzVlad commented 1 year ago

Is jiterp enabled by default ? Do we have msbuild property to disable it ? Maybe also disabling AOT is worth trying.

andivlad-talentia commented 1 year ago

I wasn't able to reproduce this with VS 17.8 Preview 3.0 (OP used 2.0), which seems to be using the same rc1 version.

@andivlad-talentia Could you please share how to reproduce this?

  1. Is this with a default template project? Any changes made to the project?
  2. How are you building, and running the app?
  3. Can you also share the output of dotnet --info from command line?
  4. Are you able to reproduce this from the command line, starting with no existing bin, and obj directories? If you, then can you please add /bl to that, and share the generated msbuild.binlog?
  1. The default project, started making configurations, it works perfectly with net7.0 but not net8.0, also enabled/disabled various flags, doesn't seem to be working either way

    
    <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
    
    <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <!--<TargetFramework>net7.0</TargetFramework>-->
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    
    <!--test flags group
    <WasmStripILAfterAOT>false</WasmStripILAfterAOT>
    <PublishTrimmed>false</PublishTrimmed>
    <WasmEnableWebcil>true</WasmEnableWebcil>
    <BlazorWebAssemblyJiterpreter>false</BlazorWebAssemblyJiterpreter>
    <WasmEnableSIMD>false</WasmEnableSIMD>
    <WasmEnableExceptionHandling>false</WasmEnableExceptionHandling>
    <RunAOTCompilation>false</RunAOTCompilation>
    -->
    </PropertyGroup>
    
    <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.1.23421.29" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-rc.1.23421.29" PrivateAssets="all" />
      <!--
      <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*" />
      <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.*" PrivateAssets="all" />
    -->
    
    </ItemGroup>



2. Visual studio interface -> Build project -> Start without debugging (debug fails to launch adapter)
3. ![image](https://github.com/dotnet/runtime/assets/67757358/1586bc2f-ab3e-4b0b-be9c-99fbbcb42599)

4. Unsure how to start it outside of publishing it and hosting it in IIS... this yields a different error:
![image](https://github.com/dotnet/runtime/assets/67757358/89b84737-250c-4710-87c8-326b133c1d91)

[msbuild.binlog_renamed.log](https://github.com/dotnet/runtime/files/12724880/msbuild.binlog_renamed.log)
andivlad-talentia commented 1 year ago

Is jiterp enabled by default ? Do we have msbuild property to disable it ? Maybe also disabling AOT is worth trying.

I think its this flag: <WasmEnableExceptionHandling>true</WasmEnableExceptionHandling>

As it comes with the following runtime options: image

It doesn't solve the problem though :(

maraf commented 1 year ago

Is jiterp enabled by default ? Do we have msbuild property to disable it ? Maybe also disabling AOT is worth trying.

Yes, it's on by default. It can be disabled with <BlazorWebAssemblyJiterpreter>false</BlazorWebAssemblyJiterpreter>

andivlad-talentia commented 1 year ago

Ok figured it can run in command line (donno why i always thought blazor projects can't be run like this), still got the same error

dotnet run --sc BlazorApp2.csproj

Attached the project for reference BlazorApp2.zip

maraf commented 1 year ago

I can't repro it on provided BlazorApp2 even with exact same version 8.0.100-rc.1.23455.8 (outside of VS). The used runtime pack and workload matches 8.0.0-rc.1.23419.4.

maraf commented 1 year ago

@andivlad-talentia Can you please verify that you don't have anything in the browser cache from previous run / different app? You can try to open the app in incognito mode

ghost commented 1 year ago

This issue has been marked needs-author-action and may be missing some important information.

andivlad-talentia commented 1 year ago

I have updated to RC2, used the new template this one seems to be working, will close the issue