vtk-js: Import 'macro' results error

https://kitware.github.io/vtk-js/docs/develop_class.html

I am following this tutorial to create new vtk.js class,

but it results error when

when I use

import macro from 'vtk.js/Sources/macro';

it results error saying

node_modules\vtk.js\Sources\macro.js:1
(function (exports, require, module, __filename, __dirname) { import vtk from './vtk';
                                                                     ^^^

SyntaxError: Unexpected identifier

How can I make a new vtk.js class without error?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 30 (1 by maintainers)

Most upvoted comments

Which version of kw-web-suite got pulled in? You may have to specify an older version. Like the one currently used in package.json.

Should do npm install kw-web-suite@10.0.0 instead of npm install kw-web-suite

FYI @floryst

I’m developing on macOS, so I’m pretty sure that won’t be an issue.

Where is the error, I only see expected warnings?

Just follow along the guide and you should be good to go.

@jourdain I imported vtk.js based on create-react-app setting. there were problems of using filename macro.js in basic react-app setting, so I copied macro.js from vtk.js source and pasted it in my project folder using different name (vtkMacro.js) and solved it temporarily…