我正在建立一個應用程序使用電子與電子反應樣板https://github.com/chentsulin/electron-react-boilerplate.git,它都工作正常。使用D3與電子反應應用程序
但是當我試圖使用D3時,電子總是會拋出錯誤zTypeError: Cannot read property 'version' of undefined. (ie : console.log(d3.version))
。
- 我按照這裏找到的說明:Can D3 library be used with the Electron (Atom shell)?,沒有結果。
- 我將腳本(https://d3js.org/d3.v3.min.js)添加到
index.html
,但沒有結果。 - 與
<script>var d3 = require("d3")</script>
相同的問題。
我的配置:
- 電子1.4.15
- 鉻53.0.2785.143
- [email protected] | win32 | 64
- 反應15.4.2
- D3 4.5.0
我希望有人能與這個問題有所幫助。
如果您使用的是最新版本的electron-react-boilerplate,您不應該將''添加到app.html? – nathan