Skip to content

Shared Worker and WasmEnableThreads #27

@nealles

Description

@nealles

Hi!
I took your demo project:
https://github.com/LostBeard/BlazorWebApp10

  1. I added WasmEnableThreads = true
  2. I added
app.Use(async (context, next) =>
{
    context.Response.Headers.Append("Cross-Origin-Embedder-Policy", "require-corp");
    context.Response.Headers.Append("Cross-Origin-Opener-Policy", "same-origin");
    await next();
});
  1. I removed inspectUri from lanchSettings.json

When I run the application Shared Worker's console shows me
VM8:6 MONO_WASM: Assert failed: SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy http headers. See also https://aka.ms/dotnet-wasm-features Error: Assert failed: SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy http headers. See also https://aka.ms/dotnet-wasm-features

Seems, headers are not working for the Shared Worker. Do I need to do anything special to make it work?

Upd: Also, I see an issue for a main thread:

SpawnDev.BlazorJS.lib.module.js:453 Callback invokeMethod error: 
['Invoke']
 null Error: Cannot call synchronous C# methods.
    at Dn (managed-exports.ts:308:23)
    at Object.<anonymous> (invoke-cs.ts:327:17)
    at Object.invokeDotNetFromJS (blazor.web.b9228eflpl.js:1:169260)
    at b.invokeDotNetMethod (blazor.web.b9228eflpl.js:1:4857)
    at I.invokeMethod (blazor.web.b9228eflpl.js:1:7025)
    at fn (SpawnDev.BlazorJS.lib.module.js:450:64)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions