graph-viz-d3-js icon indicating copy to clipboard operation
graph-viz-d3-js copied to clipboard

TypeError: asm.js type error: 'byteLength' is not a standard constant or typed array name layout-worker.js:3211:60

Open magjac opened this issue 7 years ago • 5 comments

Sorry to trouble you with newbie questions all the time. Really appreciate your help.

I get the above error message when testing this:

magjac-testing-graphviz-d3-renderer.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <script src="bower_components/requirejs/require.js" data-main="main.js"></script>
  </head>
  <body>
    <h1>magjac testing graphviz-d3-renderer</h1>
  </body>
</html>

main.js:

requirejs.config({
    //By default load any module IDs from js/lib
    baseUrl: 'js',
    //except, if the module ID starts with "app",
    //load it from the js/app directory. paths
    //config is relative to the baseUrl, and
    //never includes a ".js" extension since
    //the paths config could be for a directory.
    paths: {
        d3: '/bower_components/d3/d3',
        "dot-checker": '/bower_components/graphviz-d3-renderer/dist/dot-checker',
        "layout-worker": '/bower_components/graphviz-d3-renderer/dist/layout-worker',
        worker: '/bower_components/requirejs-web-workers/src/worker',
        renderer: '/bower_components/graphviz-d3-renderer/dist/renderer',
    }
});

require(["renderer"],
  function (renderer) {

  dotSource = 'digraph xyz { a -> b }';
  // initialize svg stage
  renderer.init("#graph");

  // update stage with new dot source
  renderer.render(dotSource);
});

magjac avatar Mar 19 '17 17:03 magjac

But you have no element in your body with id graph. Another story is that script with data-main is usually placed at the end of body not in head.

mstefaniuk avatar Mar 19 '17 19:03 mstefaniuk

Thanks, with a div id="graph", the graph renders, but the error message is still present.

Regarding the script placement, it makes no difference. I got it from http://requirejs.org/docs/start.html

I see the same error message on http://graphviz.it/

magjac avatar Mar 19 '17 21:03 magjac

If you are submitting such bug remember to provide steps to reproduce which in that case should cover browser kind and version as well as operating system. To keep it short - it works on my environment.

mstefaniuk avatar Mar 20 '17 17:03 mstefaniuk

Sorry. The test above was made using: server: lighttpd/1.4.33 on Ubuntu 14.04.5 LTS client: Firefox 52.0.1 (32-bit) on Windows 7.

magjac avatar Mar 21 '17 05:03 magjac

I don't see the problem with Google Chrome Version 56.0.2924.87 (64-bit) on Windows 7.

magjac avatar Mar 21 '17 05:03 magjac