Browser support for `std/hash`
See original GitHub issueI am trying to call createHash()
from a bundled library loaded in a web browser, but the bundled JavaScript file has to compile WASM that the browser reports is too big for the main thread:
Uncaught RangeError: WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread. at issue.bundle.js:253
Description of demo files attached in WebAssembly.Compile_issue.zip:
- issue.ts:
import { createHash } from "https://deno.land/std@0.106.0/hash/mod.ts";
const hash = createHash("sha256");
hash.update("Some data to be hashed");
console.log(hash.toString());
- issue.bundle.js: Generated via
deno bundle issue.ts issue.bundle.js
. The line 253 of concern is
const wasmModule = new WebAssembly.Module(decode("AGFzbQEAAAAB [...]
- issue.html: Imports the JS bundle via
<script type="module" src="issue.bundle.js"></script>
Serving and browsing to issue.html
results in the above error regarding WebAssembly.Compile
.
If I’m expecting too much of the bundler here, what’s the simplest workaround to be able to call createHash()
from a library loaded in a browser? Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Location API: hash | Can I use... Support tables for ... - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >StdHash, Tie::ExtraHash - base class definitions for tied hashes
Tie::Hash has legacy support for the new method: it is used if TIEHASH is not defined in the case a class forgets to...
Read more >Supported Browsers - UBC's Learning Technology Hub
Google Chrome Safari Find out which browser versions are supported
Google Chrome Safari Canvas Yes Yes¹
ComPAIR Yes Yes
edX Edge Yes Yes All edX Edge...
Read more >Supported Browsers : State of Oregon
To ensure the safety & security of your browsing experience, Oregon.gov websites are compatible with most popular web browsing software.
Read more >Which browsers work with Microsoft 365 for the web and ...
Browser support for Microsoft 365 for the web and Microsoft 365 Add-ins. ... Note: Microsoft 365apps and services will not support Internet Explorer...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue should probably be closed. std/hash has been removed from std.
Thanks!