Skip to content

Difficulties including library in client-side code #24

@p3k

Description

@p3k

When I include the library together with RequireJS like the following in an HTML page I get the error and stack trace below:

<script src='https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.js'></script>
<script>
  require(['http://cpettitt.github.io/project/graphlib-dot/latest/graphlib-dot.js'], function(dot) {
    console.log(dot);
  });
</script>
Uncaught TypeError: Cannot read property 'Graph' of undefined
  3../graphlib @ graphlib-dot.js:55
  s @ graphlib-dot.js:1
  (anonymous function) @ graphlib-dot.js:1
  8../build-graph @ graphlib-dot.js:2619
  s @ graphlib-dot.js:1
  (anonymous function) @ graphlib-dot.js:1
  2../lib/graphlib @ graphlib-dot.js:28
  s @ graphlib-dot.js:1
  (anonymous function) @ graphlib-dot.js:1
  (anonymous function) @ graphlib-dot.js:24
  1../index @ graphlib-dot.js:26
  s @ graphlib-dot.js:1e @ graphlib-dot.js:1
  (anonymous function) @ graphlib-dot.js:1

What do I need to do to make graphlib-dot work with RequireJS (which is a requirement)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions