mdn / mdn/content

Explicit the expected MIME type(s) for WebAssembly module

Open
#43,024 2 comments 0 reactions 1 assignee Claimed by @chrisdavidmills View on GitHub
Content:HTTP effort: small
Dominant language
Markdown
Stars
11k
Forks
23.2k
Avg merge
2d 9h
Merged PRs (30d)
331

Description

### MDN URL

https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/compileStreaming_static

### What specific section or headline is this issue about?

#exceptions

### What information was incorrect, unhelpful, or incomplete?

A tiny bit of context.

I'm trying to serve a wasm-compiled app behind an Nginx.
I'm getting the following error in the browser console upon calling the `compileStreaming` method of the `WebAssembly` namespace:
`Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.`
The error is very clear: my Nginx indeed sent the `.wasm` file with a `Content-Type: text/plain`.

*So far so good.*

So, what is/are the corrected/expected MIME type(s) for a `.wasm` file?
I expected to find the answer in MDN, however I simply cannot find it on the Internet at all, and I need this piece of info.

### What did you expect to see?

1. Find explicitly a/the correct MIME type there :
```diff
+ (e.g., bad MIME type instead of [insert it/them here please])
- (e.g., bad MIME type)
```

2. Or in more “general” places, like on the page of MIME types, or pages about using wasm in the browser, etc.

### Do you have any supporting links, references, or citations?

Couldn't find correct the MIME type(s) at all...

### Do you have anything more you want to share?

_No response_

### MDN metadata

Page report details

* Folder: `en-us/webassembly/reference/javascript_interface/compilestreaming_static`
* MDN URL: https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/compileStreaming_static
* GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/webassembly/reference/javascript_interface/compilestreaming_static/index.md
* Last commit: https://github.com/mdn/content/commit/006c05b688814b45a01ad965bbe4ebfc15513e74
* Document last modified: 2025-04-22T17:31:44.000Z

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.