# VTK.js - electron

**URL:** https://discourse.vtk.org/t/vtk-js-electron/5568
**Category:** Web
**Created:** [April 18, 2021, 12:48pm UTC](https://discourse.vtk.org/t/vtk-js-electron/5568 "2021-04-18T12:48:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hiiragii](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hiiragii/32/3257_2.png) [@hiiragii](https://discourse.vtk.org/u/hiiragii)
#### Post date: [April 18, 2021, 12:48pm UTC](https://discourse.vtk.org/t/vtk-js-electron/5568/1 "2021-04-18T12:48:47Z")

</div>

Hello everyone,  
Newbie here so go easy on me 😁

I’m trying to run the planesource ([vtk.js](https://kitware.github.io/vtk-js/examples/PlaneSource.html)) example in an electron app. After 2 days of trying out different boilerplates and following different guides I still can’t get vtk to run the example within electron.

Does anyone here have and/or is willing to share a very basic template where vtk is correctly imported and running into an electron app? ([GitHub - pijaginw/electron-vtk-app: Simple app for visualisation of 3D objects made with JavaScript, Electron and vtk.js.](https://github.com/pijaginw/electron-vtk-app) this one doesn’t compile)

Any advice is greatly appreciated  
Thanks!

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [April 20, 2021, 2:57pm UTC](https://discourse.vtk.org/t/vtk-js-electron/5568/2 "2021-04-20T14:57:56Z")

</div>

Hi, I threw together a planesource + electron demo, as can be found here: [GitHub - floryst/vtk-js-electron: Electron sample running vtk.js PlaneSource](https://github.com/floryst/vtk-js-electron)

This repo uses the new `@kitware/vtk.js` ESM build, so FYI there are no docs on it (yet). In addition, I’ve left out the control panel that you typically see with that example, since I was being hasty and didn’t want to bring in the html-loader rules.

The general gist of this is that you need to import and use vtk.js inside the renderer process. In addition, be sure to tell webpack to use `source-map` devtool, otherwise you encounter a CSP error.

---

<div class="post-metadata">

### Author: ![hiiragii](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hiiragii/32/3257_2.png) [@hiiragii](https://discourse.vtk.org/u/hiiragii)
#### Post date: [April 20, 2021, 8:02pm UTC](https://discourse.vtk.org/t/vtk-js-electron/5568/3 "2021-04-20T20:02:12Z")

</div>

Thank you so much!  
This is exactly what I was looking for
