dotnet / runtime

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

Blazor Web App will not load webassembly component on virtualized machines with Chromium browser #103072

Open mtbayley opened 3 months ago

mtbayley commented 3 months ago

Is there an existing issue for this?

Describe the bug

I can't think of how this is possible, but I get this message on startup of my published AOT compiled Blazor Web App. Some machines have no problem loading the site, but some machines show this error consistently.

Any help on where to look would be appreciated

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

blazor.web.js:1  Error: AggregateException_ctor_DefaultMessage (EndOfStringNotFound Path: $['__internal__AntiforgeryRequestToken'] | LineNumber: 0 | BytePositionInLine: 2340.)
    at Jn (dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:31614)
    at Tl (dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:182415)
    at 0fd5c22a:0x27ba236
    at 0fd5c22a:0x27bbcf8
    at 0fd5c22a:0x27c169c
    at 0fd5c22a:0x2f2f5a4
    at 0fd5c22a:0x31d0e0e
    at 0fd5c22a:0x31ede66
    at 0fd5c22a:0x31cd780
    at 0fd5c22a:0x31c0b7d
callEntryPoint @ blazor.web.js:1
await in callEntryPoint (async)
ti @ blazor.web.js:1
await in ti (async)
ei @ blazor.web.js:1
startWebAssemblyIfNotStarted @ blazor.web.js:1
resolveRendererIdForDescriptor @ blazor.web.js:1
determinePendingOperation @ blazor.web.js:1
refreshRootComponents @ blazor.web.js:1
(anonymous) @ blazor.web.js:1
setTimeout (async)
rootComponentsMayRequireRefresh @ blazor.web.js:1
onDocumentUpdated @ blazor.web.js:1
Ki @ blazor.web.js:1
Ji @ blazor.web.js:1
(anonymous) @ (index):770

.NET Version

8.0.6

Anything else?

No response

mtbayley commented 3 months ago

I can confirm that the issue is gone when RunAOTCompilation is false

javiercn commented 3 months ago

@mtbayley thanks for contacting us.

This seems like a bug in the AoT process. Do you happen to have a repro project that we can use to troubleshoot this issue? In the meantime I'm going to transfer this to the runtime so they can investigate.

javiercn commented 3 months ago

@lewing FYI

mtbayley commented 3 months ago

Hi @javiercn, @lewing Here's a link to a minimal repro project. It is just the Blazor web app template with RunAOTCompilation set to true

https://github.com/mtbayley/TestAot

I've been able to trigger it on some machines by navigating to the Counter page. Then loading the Weather page. Then going back to the Counter page. Same exception occurs.

mtbayley commented 3 months ago

Another update: The machines that it fails on are all virtualized. All physical machines I have tested so far have no issues

mtbayley commented 3 months ago

On the virtualized machines, only chromium based browsers do not work (chrome, edge). Firefox works.

mtbayley commented 3 months ago

Setting WasmEnableSIMD to false works around the issue. I can't understand why. SIMD should be supported by all major browsers

maraf commented 3 months ago

Looks similar as https://github.com/dotnet/runtime/issues/96004

steveisok commented 2 months ago

@maraf is there any action we can take?