I'm building an app using electron with electron-react-boilerplate found here https://github.com/chentsulin/electron-react-boilerplate.git , it's all working fine.
But when I am trying to use D3, electron always throws me the error zTypeError: Cannot read property 'version' of undefined. (ie : console.log(d3.version) )
zTypeError: Cannot read property 'version' of undefined. (ie : console.log(d3.version) )
.
index.html
, with no result. <script>var d3 = require("d3")</script>
. My Config:
I hope someone can help with this issue.
I simply use var d3 = require('d3');
at the top of any jsx file that requires d3. This works for both of the electron + d3 based apps that I am currently working on.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.