webpack-dev-server Version: 3.1.10
[x] This is a bug
// webpack.config.js
...
devServer: {
contentBase: path.join(__dirname, 'build/bundle'),
watchContentBase: true,
}
...
.wasm files should have "application/wasm" content type.
Got "application/octet-stream"
The files generate by webpack work fine. The issue only happen with the static files in contentBase folder.
mime version: 1.6.0
mime-types version: 2.1.21
Both two package return "application/wasm" when lookup .wasm files.
@samsam2310 can't reproduce, please create minimum reproducible test repo
Hi @evilebottnawi
Here is the test repo: https://github.com/samsam2310/wp-bug
I have tried this and got the same result, hope this will help.
Thanks
Hi @evilebottnawi
It seems like package "send" use a old version of node mime package, therefore, the .wasm file has wrong mime type.
There is a PR which have been merged since one month ago, so the issue should be fixed after next update.
@samsam2310 feel free to send a PR with fix
Hi @evilebottnawi
The "send" package is used by express.js, so I think there is no need to add a new pr.
But we need to wait for the next release of express.js.
@samsam2310 Do you have link on express.js issue?
@evilebottnawi You can take a look about the PR I posted above : https://github.com/pillarjs/send/pull/154
It seems like it should be released with [email protected], but it didn't.
And this issue https://github.com/expressjs/express/issues/3589 says it will be released with [email protected], but 4.17 disappeared and it seems like the next release will be 5.0.0 (There is a new release 5.0.0-alpha).
So, ... I don't know....
If this is important, maybe we could add express.static.mime.types["wasm"] = "application/wasm"; until the next release of express.
@samsam2310 strange, Yes, it will be in the 4.17 release +1 should be solve :confused: Can you send a PR with test, maybe we need update deps
@evilebottnawi
I don't think this can fixed, or, for now it can't.
It seems like there isn't [email protected], the latest release is 4.16.4.
And the issue is caused by [email protected] (bind with express.js) which lock mime to @1.4.1, and the latest release of send is released on Feb 8, 2018.
@samsam2310 hm, here PR https://github.com/expressjs/express/pull/3778/files, maybe we need workaround before this will be released
@evilebottnawi ok, I can make a PR with a workaround solution.