Hi Guys,
Sorry if this isn't the correct place to talk about this, I wasn't for sure if I should be talking about this here for over in electron somewhere. I am piddling around with Electron and a web assembly C# SPA framework called Blazor that I'm wanting to try and get working without having a web server back-end. I figured I would be able to just load all the client-side files from a folder just like with referencing local js files in a .html file using relative pathing and such.
The error I'm running across is "TypeError: Incorrect response MIME type. Expected 'application/wasm'." when trying to run this bit of code...
<script>
WebAssembly.instantiateStreaming(fetch("relative/path/to/file.wasm", {
credentials: "same-origin",
headers: {
"Content-Type": "application/wasm"
}
}), {}).then(output => {
console.log(output);
}).catch(reason => {
console.log(reason);
});
</script>
The headers portion of the code is my own doing to attempt to get around the error, I figured I could just tell it what the Content-Type is rather than it expecting it from the response since it's getting it off the file system, but I guess it's just using it to verify the response headers?
I'm fairly ignorant about WebAssembly in general, looking for some possible advice on how to workaround the error.