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

Error on Safari #34

Open
wh1t3cAt1k opened this issue Oct 31, 2022 · 1 comment
Open

Error on Safari #34

wh1t3cAt1k opened this issue Oct 31, 2022 · 1 comment

Comments

@wh1t3cAt1k
Copy link

wh1t3cAt1k commented Oct 31, 2022

I am seeing the following error in an app running in a WKWebView (an Office.js add-in to the Microsoft Excel for Mac, where the add-in is run in a webview IFrame in a side panel):

Webassembly.Module doesn't parse at byte 90: references are not enabled, in function at index 3.

Strangely, the host machine has Safari 16 installed, and if I open Excel Online in a browser tab, where the same add-in runs, again, in an IFrame in a side panel, - it executes xxhash-wasm without any hiccups.

Could you, judging by the error message, point me in the direction of what can be wrong here, and if the reason is clear already, any potential workarounds barring using a pure-JS implementation?

It almost feels like WKWebView uses a different WebKit engine version, or is more limited with regards to WASM. 🤔

@jungomi
Copy link
Owner

jungomi commented Nov 1, 2022

The WebView version most likely uses an older or maybe restricted version of WASM. I'm not quite sure what that error is, because there are no references (such as externref) used within the whole WASM code, but I'm assuming that is related to bulk memory operations that have been integrated into xxhash-wasm@1.0.0.

As an alternative you could try to use xxhash-wasm@0.4.2, which is a bit slower but still a lot faster than any pure-JS implementation. Just have a look at the breaking changes in the v1.0.0 release page. If you only calculate the hashes with the default seed (no seed specified) and use them for a comparison (equality check), none of the breaking changes should affect you.

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

2 participants