Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get mime type "application/octet-stream" for wasm files #1575

Closed
1 of 2 tasks
samsam2310 opened this issue Nov 20, 2018 · 11 comments · Fixed by #1580
Closed
1 of 2 tasks

Get mime type "application/octet-stream" for wasm files #1575

samsam2310 opened this issue Nov 20, 2018 · 11 comments · Fixed by #1580

Comments

@samsam2310
Copy link
Contributor

samsam2310 commented Nov 20, 2018

  • Operating System: ArchLinux
  • Node Version: v11.0.0
  • NPM Version: 6..4.1
  • webpack Version: 4.26.0
  • webpack-dev-server Version: 3.1.10
  • This is a bug
  • This is a modification request

Code

  // webpack.config.js
  ...
  devServer: {
    contentBase: path.join(__dirname, 'build/bundle'),
    watchContentBase: true,
  }
  ...

Expected Behavior

.wasm files should have "application/wasm" content type.

Actual Behavior

Got "application/octet-stream"

For Bugs; How can we reproduce the behavior?

The files generate by webpack work fine. The issue only happen with the static files in contentBase folder.

More information:

mime version: 1.6.0
mime-types version: 2.1.21
Both two package return "application/wasm" when lookup .wasm files.

@alexander-akait
Copy link
Member

alexander-akait commented Nov 20, 2018

@samsam2310 can't reproduce, please create minimum reproducible test repo

@samsam2310
Copy link
Contributor Author

samsam2310 commented Nov 21, 2018

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

@samsam2310
Copy link
Contributor Author

samsam2310 commented Nov 26, 2018

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.

pillarjs/send#154

@alexander-akait
Copy link
Member

alexander-akait commented Nov 26, 2018

@samsam2310 feel free to send a PR with fix

@samsam2310
Copy link
Contributor Author

samsam2310 commented Nov 27, 2018

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.

@alexander-akait
Copy link
Member

alexander-akait commented Nov 27, 2018

@samsam2310 Do you have link on express.js issue?

@samsam2310
Copy link
Contributor Author

samsam2310 commented Nov 27, 2018

@evilebottnawi You can take a look about the PR I posted above : pillarjs/send#154

It seems like it should be released with send@0.16.2, but it didn't.
And this issue expressjs/express#3589 says it will be released with express@4.17, 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.

@alexander-akait
Copy link
Member

alexander-akait commented Nov 27, 2018

@samsam2310 strange, Yes, it will be in the 4.17 release +1 should be solve 😕 Can you send a PR with test, maybe we need update deps

@samsam2310
Copy link
Contributor Author

samsam2310 commented Nov 27, 2018

@evilebottnawi
I don't think this can fixed, or, for now it can't.
It seems like there isn't express@4.17, the latest release is 4.16.4.
And the issue is caused by send@0.16.2 (bind with express.js) which lock mime to @1.4.1, and the latest release of send is released on Feb 8, 2018.

@alexander-akait
Copy link
Member

alexander-akait commented Nov 27, 2018

@samsam2310 hm, here PR https://github.com/expressjs/express/pull/3778/files, maybe we need workaround before this will be released

@samsam2310
Copy link
Contributor Author

samsam2310 commented Nov 27, 2018

@evilebottnawi ok, I can make a PR with a workaround solution.

samsam2310 added a commit to samsam2310/webpack-dev-server that referenced this issue Nov 27, 2018
samsam2310 added a commit to samsam2310/webpack-dev-server that referenced this issue Nov 27, 2018
samsam2310 added a commit to samsam2310/webpack-dev-server that referenced this issue Nov 27, 2018
matheus1lva pushed a commit to matheus1lva/GrCartuchos that referenced this issue Dec 21, 2018
## The devDependency [webpack-dev-server](https://github.com/webpack/webpack-dev-server) was updated from `3.1.10` to `3.1.11`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v3.1.11</summary>

<p><a name="user-content-3.1.11"></a></p>
<h2><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/compare/v3.1.10...v3.1.11">3.1.11</a> (2018-12-21)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>bin/options:</strong> correct check for color support (<code>options.color</code>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1555" data-hovercard-type="pull_request" data-hovercard-url="/webpack/webpack-dev-server/pull/1555/hovercard">#1555</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/55398b5">55398b5</a>)</li>
<li><strong>package:</strong> update <code>spdy</code> v3.4.1...4.0.0 (assertion error) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1491" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack-dev-server/issues/1491/hovercard">#1491</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1563" data-hovercard-type="pull_request" data-hovercard-url="/webpack/webpack-dev-server/pull/1563/hovercard">#1563</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/7a3a257">7a3a257</a>)</li>
<li><strong>Server:</strong> correct <code>node</code> version checks (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1543" data-hovercard-type="pull_request" data-hovercard-url="/webpack/webpack-dev-server/pull/1543/hovercard">#1543</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/927a2b3">927a2b3</a>)</li>
<li><strong>Server:</strong> mime type for wasm in contentBase directory (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1575" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack-dev-server/issues/1575/hovercard">#1575</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1580" data-hovercard-type="pull_request" data-hovercard-url="/webpack/webpack-dev-server/pull/1580/hovercard">#1580</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/fadae5d">fadae5d</a>)</li>
<li>add url for compatibility with webpack@5 (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1598" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack-dev-server/issues/1598/hovercard">#1598</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1599" data-hovercard-type="pull_request" data-hovercard-url="/webpack/webpack-dev-server/pull/1599/hovercard">#1599</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/68dd49a">68dd49a</a>)</li>
<li>check origin header for websocket connection (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/issues/1603" data-hovercard-type="pull_request" data-hovercard-url="/webpack/webpack-dev-server/pull/1603/hovercard">#1603</a>) (<a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/b3217ca">b3217ca</a>)</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 9 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/ff2874f5f3a90e5727434cc10f69ac4d54896033"><code>ff2874f</code></a> <code>chore(release): 3.1.11</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/b3217ca8dc6b371a160b6749b949ab09d7b9f6d7"><code>b3217ca</code></a> <code>fix: check origin header for websocket connection (#1603)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/68dd49a5e44b270061e4746b2e01bbc72589ca3b"><code>68dd49a</code></a> <code>fix: add url for compatibility with webpack@5 (#1598) (#1599)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/fadae5da6ba0261cade08164feeaad99b1de6b79"><code>fadae5d</code></a> <code>fix(Server): mime type for wasm in contentBase directory (#1575) (#1580)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/7a3a2579179b2ca0fd91405d9872ba2c3ed8db3a"><code>7a3a257</code></a> <code>fix(package): update <code>spdy</code> v3.4.1...4.0.0 (assertion error) (#1491) (#1563)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/1fe82dee4eef600946b2601a2d853cffbe65db0a"><code>1fe82de</code></a> <code>ci(travis): Node 11 (on OS X) crashes, use 10 for now (#1588)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/55398b5de17b9a845b1ee5aaa90bb2002c25ddfb"><code>55398b5</code></a> <code>fix(bin/options): correct check for color support (<code>options.color</code>) (#1555)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/927a2b38d4d3a5d8fd50dfce0343634d46fa8a92"><code>927a2b3</code></a> <code>fix(Server): correct <code>node</code> version checks (#1543)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/commit/fa96a76e9e5507bbf874044be0d95872768abf5e"><code>fa96a76</code></a> <code>chore(PULL_REQUEST_TEMPLATE): allow features (#1539)</code></li>
</ul>
<p>See the <a href="https://urls.greenkeeper.io/webpack/webpack-dev-server/compare/fe3219f614ad84afbaab1ecbd1d9aec4ff337d37...ff2874f5f3a90e5727434cc10f69ac4d54896033">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
This was referenced Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants