question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: abort(CompileError: WebAssembly.instantiate():

See original GitHub issue

Everytime I try to load d3-graphviz in my vuejs, I get the following console error and no graph is generated. Can someone please help. My fronted debugging skills are very poor. d3-@3.0.5

Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -s ASSERTIONS=1 for more info.

Here is my vue component

<template>
  <div>
    <h3>from Component</h3>
    <div id="graph"></div>
  </div>
</template>

<script>
import * as d3 from 'd3';
import 'd3-graphviz';

export default {
  data() {
    return {
      code: 'digraph {a -> b}'
    };
  },
  mounted() {
    console.log(d3.select('#graph').graphviz("#graph").renderDot(this.code))
    d3.select('#graph').graphviz("#graph").renderDot(this.code);
  }
};
</script>

Screenshot from 2020-05-05 13-07-31

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (21 by maintainers)

github_iconTop GitHub Comments

3reactions
magjaccommented, May 8, 2020

Even better is to create a symbolic link which you can commit to git and then never worry about again:

mkdir -p public/js
cd public/js
ln -s ../../node_modules/@hpcc-js/wasm/dist/graphvizlib.wasm .
git add graphvizlib.wasm 
git commit
1reaction
GordonSmithcommented, May 9, 2020

If your pinned then you don’t have anything to do - but your essentially releasing two versions of your library - a bundled version (main) and an es6 version (jsnext).

The bundled version “probably” contains my wrapper versioned as of the time you built the bundle. While the JSNext version only references a local copy of @hpcc-js/wasm - which may well be newer (when using the hat). So there is potential for them to be out of sync in a “consumers” development environment.

(if you don’t bundle my wrapper then your probably ok).

Also I need to fix my auto versioning to be a bit stricter…

Read more comments on GitHub >

github_iconTop Results From Across the Web

CompileError: WebAssembly.compile() - Stack Overflow
In general, this error means that instead of the binary .wasm file your browser received something else. That can ...
Read more >
WebAssembly.instantiate() - MDN Web Docs
The WebAssembly.instantiate() function allows you to compile and instantiate ... RuntimeError , depending on the cause of the failure.
Read more >
Loading WebAssembly Modules in JavaScript | by Urvashi
WebAssembly.instantiate() is used to compile and instantiate bytes at the same time ... Uncaught RuntimeError: abort(Assertion failed: native function `Sum` ...
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 ... failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): ...
Read more >
talib-web - npm
TA-Lib C code ported to WebAssembly. ... Error: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found