Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'select' of undefined #563

Closed
doonetheprune opened this issue Aug 24, 2017 · 4 comments
Closed

TypeError: Cannot read property 'select' of undefined #563

doonetheprune opened this issue Aug 24, 2017 · 4 comments

Comments

@doonetheprune
Copy link

Hi

I am doing the following as per your example however I am getting the following error. I am using webpack

   var mermaid = require('mermaid').mermaidAPI;

   mermaid.initialize({
      startOnLoad:false
   });

   var cb = function(html){
      console.log(html);
   }

   mermaid.render('frogs',graphDefinition,cb);
 TypeError: Cannot read property 'select' of undefined
     at SVGGElement.<anonymous> (create-edge-labels.js:22)
     at d3.js:962
     at d3_selection_each (d3.js:968)
     at Array.d3_selectionPrototype.each (d3.js:961)
     at createEdgeLabels (create-edge-labels.js:20)
     at fn (render.js:24)
     at Object.exports.draw (flowRenderer.js:411)
     at render (mermaidAPI.js:401)
     at Object.exports.render (mermaidAPI.js:493)
@tylerlong
Copy link
Collaborator

@doonetheprune
Copy link
Author

Have you got any more information?

@tylerlong
Copy link
Collaborator

As the code sample shown, you can use it like this:

import mermaid from 'mermaid'

mermaid.initialize({
  theme: 'forest'
})

@tylerlong
Copy link
Collaborator

Here is a demo for webpack: https://github.com/mermaidjs/mermaid-webpack-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants