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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm mime type #948

Closed
salzhrani opened this issue Jul 7, 2018 · 13 comments
Closed

Wasm mime type #948

salzhrani opened this issue Jul 7, 2018 · 13 comments

Comments

@salzhrani
Copy link

馃悰 bug report

Description of the problem

.wasm files need to be served with mime-type application/wasm in order for it to work

How has this issue affected you? What are you trying to accomplish?

run a wasm module.

Your Environment

Browser : google chrome
Operating System: mac os

@codesandbox-stale-bot
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@SaraVieira
Copy link
Contributor

Issue closed due to lack of activity

@hexrcs
Copy link

hexrcs commented Mar 14, 2020

@SaraVieira Can this be reopened? :)

It seems that CodeSandbox currently serves WASM binaries as application/octet-stream instead of application/wasm. This should probably be fixed from the serverside instead of the client.

Screen Shot 2020-03-14 at 15 05 02

Looks like it's probably because express is not up-to-date - 4.17 seems to have the fix (related issue). Not sure if this repo contains related code, but standalone-packages/codesandbox-browserfs has version 4.15.4

@SaraVieira SaraVieira reopened this Mar 14, 2020
@SaraVieira
Copy link
Contributor

Hey!

Reopened and let me ping @CompuIves

@lbogdan
Copy link
Contributor

lbogdan commented Mar 14, 2020

Sandbox binary assets (files) are actually served from a Google Cloud Storage bucket, and GCS doesn't have a custom MIME type for .wasm files, so it falls back to the default application/octet-stream. The solution is to explicitly set the Content-Type: application/wasm header for .wasm files when we upload them to GCS. This might also be an issue for other "exotic" file types.

Cc @CompuIves

@lbogdan
Copy link
Contributor

lbogdan commented Mar 14, 2020

@hexrcs In the meanwhile, I manually set the proper content type for https://uploads.codesandbox.io/uploads/user/5b0619d8-6846-415b-b3f2-5f62a6b67a40/eRQ5-main.wasm, can you please confirm it's now working?

@hexrcs
Copy link

hexrcs commented Mar 14, 2020

@lbogdan Yes it is :)

@garethx garethx removed the stale? label May 14, 2020
@github-actions
Copy link

github-actions bot commented Sep 4, 2020

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

@github-actions github-actions bot added the stale label Sep 4, 2020
@github-actions
Copy link

This issue has been automatically closed because there wasn't any activity after the previous notice or the stale label wasn't removed.

@n0x3u5
Copy link

n0x3u5 commented Oct 19, 2020

Hi!

I seem to be stuck on the same issue here. I still seem to be receiving an incorrect MIME type for WASM files in my Sandboxes.

Is there some way for me to set the proper content type manually like @lbogdan has done? I don't think https://uploads.codesandbox.io/ is meant to be accessed by me.

cc @SaraVieira @CompuIves

@CompuIves
Copy link
Member

Oh yeah you're right! The server probably doesn't upload this file with the right mime types to the bucket, do you have time to double check this @sannek ?

@CompuIves CompuIves reopened this Oct 20, 2020
@github-actions github-actions bot removed the stale label Oct 21, 2020
@pjoe
Copy link

pjoe commented Nov 2, 2020

What about .wasm files from npm packages? Not working for me, see e.g. https://codesandbox.io/s/friendly-yonath-is9ut

@sannek
Copy link
Contributor

sannek commented Nov 16, 2020

We've just (finally) deployed a fix for this, and .wasm files should now have the proper content types! Let me know if you encounter any further issues. Sorry it took so long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants