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

Safari can't load web assembly in dev #1143

Closed
ianpurvis opened this issue Nov 24, 2020 · 3 comments
Closed

Safari can't load web assembly in dev #1143

ianpurvis opened this issue Nov 24, 2020 · 3 comments

Comments

@ianpurvis
Copy link
Contributor

Describe the bug

The dev server version of Vite's wasm helper does not work in Safari due to undefined WebAssembly.instantiateStreaming

[Error] Unhandled Promise Rejection: TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(fetch("/wasm/simple.wasm"), opts)', 'WebAssembly.instantiateStreaming' is undefined)
	(anonymous function) (simple.wasm:2)
	promiseReactionJob

Reproduction

Run the playground and view the test page in Safari to see the error in the browser console.

$ cd playground
$ yarn install
$ npx vite

System Info

  • vite version: 0d2768d (master)
  • Operating System: macOS 11.0.1
  • Node version: v14.15.0
@ianpurvis
Copy link
Contributor Author

Fixed in #1144

@remorses
Copy link
Contributor

a better solution to this would be to use a polyfill like https://www.npmjs.com/package/wasm-instantiate-streaming (if we want to support safari)

@ianpurvis
Copy link
Contributor Author

@remorses Thanks for checking it out. That ponyfill repo seems to have been deprecated? Anyways, seems kind of heavy for this...

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants