[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[x] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->
I'm compiling WebAssembly (*.wasm) files and can't serve these properly to the browser.
Any ".wasm"-file is of content-type: "application/octet-stream"
The proper content-type should be "application/wasm"
Browser:
- [ ] Chrome (desktop) version XX
- [x] Firefox version 62.0.2
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Live Server: 5.1.1
- Platform: Windows, compiling in WSL-ubuntu
- Visual Studio Code: 1.27.2
This *feature is required in Chrome v79 too.
Please tell me when it will be ok :)
I'm still having this issue on chrome 83 and mac os
I also still have this problem. Here is a quick work around though, if you need it:
I only have the MIME-type issue, when I try to load my wasm-module via the WebAssembly.instantiateStreaming(fetch('path/to/my_module.wasm')) -API.
With the slightly more verbose an less efficient API: WebAssembly.instantiate(bytes) the import works completely fine.
Both in comparison:
```
// Desired API-usage (Currently apparently not working with Live-Server plugin)
async function getModuleFunctions() {
const resultObject = await WebAssembly.instantiateStreaming(fetch('path/to/my_module.wasm'));
return resultObj.instance.exports;
}
// Older API as work-around
async function getModuleFunctions() {
const fetchResult = await fetch('path/to/my_module.wasm');
const bytes = await fetchResult.arrayBuffer();
const resultObj = await WebAssembly.instantiate(bytes);
// The functions reside in the exports section on the resultObject.instance
return resultObj.instance.exports;
}
how is this still not fixed...
Most helpful comment
I also still have this problem. Here is a quick work around though, if you need it:
I only have the MIME-type issue, when I try to load my wasm-module via the
WebAssembly.instantiateStreaming(fetch('path/to/my_module.wasm'))-API.With the slightly more verbose an less efficient API:
WebAssembly.instantiate(bytes)the import works completely fine.Both in comparison:
```
// Desired API-usage (Currently apparently not working with Live-Server plugin)
async function getModuleFunctions() {
const resultObject = await WebAssembly.instantiateStreaming(fetch('path/to/my_module.wasm'));
return resultObj.instance.exports;
}
// Older API as work-around
async function getModuleFunctions() {
const fetchResult = await fetch('path/to/my_module.wasm');
const bytes = await fetchResult.arrayBuffer();
const resultObj = await WebAssembly.instantiate(bytes);
// The functions reside in the exports section on the resultObject.instance
return resultObj.instance.exports;
}