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

Using vtk.js in Electron app #30

Closed
pijaginw opened this issue Nov 14, 2016 · 1 comment
Closed

Using vtk.js in Electron app #30

pijaginw opened this issue Nov 14, 2016 · 1 comment

Comments

@pijaginw
Copy link

I am currently trying to make an Electron app which will visualize data with vtk.js. But I have encountered a problem with importing vtk.js into my app. The exact error I am receiving, when using require('vtk.js'), is this:

D:\electron-quick-start\node_modules\vtk.js\Sources\index.js:1
(function (exports, require, module, __filename, __dirname, process, global) { import Common       from './Common';
                                                                               ^^^^^^
SyntaxError: Unexpected token import
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:528:28)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\electron-quick-start\main.js:10:13)
    at Module._compile (module.js:556:32)

So my question is - is it possible to use Electron and vtk.js together? I've tried using require('vtk') (Error: Cannot find module 'vtk'), import * from 'vtk' (SyntaxError: Unexpected token import) but nothing seems to work. I am able to run an Electron app and create Web app with vtk.js using Webpack so I don't think that there's something wrong with either of them.

@pijaginw pijaginw closed this as completed Dec 6, 2016
@jourdain
Copy link
Collaborator

jourdain commented Dec 6, 2016

Sorry to not have catch it before. I'm assuming you figure it out?

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