Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d...
See original GitHub issueApologies for the vague bug report but I’m seeing this error and not finding a whole lot on google. 'Figured I’d at least file something here as a breadcrumb for others.
Context: I have a JS webapp that used to use the <script source="...
style of importing d3
, @hpcc/wasm
, and d3-graphviz
. 'Worked great. Now I’m porting it over to ES modules, using parcel
for bundling, and it’s throwing the above error.
I assume this is because I’m not pulling in the @hpcc/wasm content properly, but not really sure what’s going on.
Installation: npm i parcel@nightly d3 @hpcc/wasm d3-graphviz
Usage:
import * as d3 from 'd3';
import '@hpcc/wasm';
import 'd3-graphviz';
// 'Not 100% sure these are the right incantations for importing these modules,
// but it gives d3 a 'graphviz' property so... I guess it's working?
const graphviz = d3.select('#graph')
.graphviz() // <-- ERROR THROWN HERE?
.renderDot(dotMarkup);
There’s a few other warnings and whatnot in Chrome’s console as well. 'Not sure if they’re relevent…
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Wasm decoding failed: expected magic word 00 61 73 6d ...
Uncaught (in promise) RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0) getting this ...
Read more >WebAssembly.instantiate(): expected magic word 00 61 73 6d ...
Uncaught (in promise) CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0.
Read more >expected magic word 00 61 73 6d - Telerik UI for Blazor
WASM Compile Error When Hosted - expected magic word and fail to execute compile. Read more in our Blazor Knowledge Base articles.
Read more >CompileError: AsyncCompile: Wasm decoding failed
CompileError : AsyncCompile: Wasm decoding failed: expected magic word 00 61 73 6d, found 21 3c 61 72 @+0. I'm expecting to see...
Read more >WebAssembly.instantiate() - MDN Web Docs
The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code. This function has two overloads:.
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 FreeTop 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
Top GitHub Comments
Thanks all for sharing. The little I know about this, I’ve learnt through @hpcc-js/wasm and Gordon so I have nothing to add other than that I’ve solved something similar with symbolic links in the d3-graphviz tests and in the graphviz-visual-editor.
If you have any suggestion for how to improve d3-graphviz in this respect, please file an enhancement issue about it and I will happily implement it. Or submit a PR if you know how to do it.
FWIW - the way I think of graphvizlib.wasm dependency is the same as any non JS resource (like an image, video or audio file) and that it needs to get copied to the public / dist folder as part of your bundle process. (If it ends up in the same folder as the bundled JS code then it should “just work”). If you do want to locate it in a different location then there are methods available to specify those. It is important that matching versions of the JS and WASM files are maintained (which as pointed out was the cause of your error above).