vtk.js issue with the ES6 example

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

vtk.js issue with the ES6 example

smurphy
Hello,

I am having issues with running the vtk.js example from
https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html.

I did exactly as instructed (at least I believe I did and cross-checked many
times).

when running
>npm run build
I get the following error

ERROR in
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl
Module parse failed: Unexpected token (18:10)
You may need an appropriate loader to handle this file type.

The entire output until this error is copied below. I also attach the
webpack.config.js file.

Tried searching online and in the forum but can't find any solutions to this
specific problem.

Thanks,
Sebastien

> mywebproject@1.0.0 build ~/VTK/Web/MyWebProject
> webpack

Hash: a6f352cb63b054c23d33
Version: webpack 4.8.3
Time: 1959ms
Built at: 2018-06-14 11:29:58
 1 asset
Entrypoint main = main.js
 [2] (webpack)/buildin/amd-define.js 88 bytes {0} [built]
 [4] (webpack)/buildin/amd-options.js 82 bytes {0} [built]
 [5] (webpack)/buildin/module.js 519 bytes {0} [built]
 [6] (webpack)/buildin/global.js 509 bytes {0} [built]
[10] ./src/controller.html 158 bytes {0} [built] [failed] [1 error]
[20] ./src/index.js + 98 modules 904 KiB {0} [built]
     | ./src/index.js 2.59 KiB [built]
     |     + 98 hidden modules
[21] crypto (ignored) 15 bytes {0} [optional] [built]
    + 25 hidden modules

WARNING in ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
1293:25-47 "export 'default' (imported as 'ComputeGradientsWorker') was not
found in './ComputeGradients.worker'
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js
 @
./node_modules/vtk.js/Sources/Rendering/Misc/FullScreenRenderWindow/index.js
 @ ./src/index.js

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production'
for this value. Set 'mode' option to 'development' or 'production' to enable
defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more:
https://webpack.js.org/concepts/mode/

ERROR in
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl
Module parse failed: Unexpected token (18:10)
You may need an appropriate loader to handle this file type.
|
=========================================================================*/



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtk.js issue with the ES6 example

Sebastien Jourdain-2
Good catch, I'll update the code, but the missing loader would be https://github.com/Kitware/vtk-js/blob/master/Utilities/config/rules-tests.js#L5-L10 and that should be part of the vtk rules.

Thanks for reporting the issue.

Seb

On Thu, Jun 14, 2018 at 3:38 AM smurphy <[hidden email]> wrote:
Hello,

I am having issues with running the vtk.js example from
https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html.

I did exactly as instructed (at least I believe I did and cross-checked many
times).

when running
>npm run build
I get the following error

ERROR in
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl
Module parse failed: Unexpected token (18:10)
You may need an appropriate loader to handle this file type.

The entire output until this error is copied below. I also attach the
webpack.config.js file.

Tried searching online and in the forum but can't find any solutions to this
specific problem.

Thanks,
Sebastien

> mywebproject@1.0.0 build ~/VTK/Web/MyWebProject
> webpack

Hash: a6f352cb63b054c23d33
Version: webpack 4.8.3
Time: 1959ms
Built at: 2018-06-14 11:29:58
 1 asset
Entrypoint main = main.js
 [2] (webpack)/buildin/amd-define.js 88 bytes {0} [built]
 [4] (webpack)/buildin/amd-options.js 82 bytes {0} [built]
 [5] (webpack)/buildin/module.js 519 bytes {0} [built]
 [6] (webpack)/buildin/global.js 509 bytes {0} [built]
[10] ./src/controller.html 158 bytes {0} [built] [failed] [1 error]
[20] ./src/index.js + 98 modules 904 KiB {0} [built]
     | ./src/index.js 2.59 KiB [built]
     |     + 98 hidden modules
[21] crypto (ignored) 15 bytes {0} [optional] [built]
    + 25 hidden modules

WARNING in ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
1293:25-47 "export 'default' (imported as 'ComputeGradientsWorker') was not
found in './ComputeGradients.worker'
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js
 @
./node_modules/vtk.js/Sources/Rendering/Misc/FullScreenRenderWindow/index.js
 @ ./src/index.js

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production'
for this value. Set 'mode' option to 'development' or 'production' to enable
defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more:
https://webpack.js.org/concepts/mode/

ERROR in
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl
Module parse failed: Unexpected token (18:10)
You may need an appropriate loader to handle this file type.
|
=========================================================================*/



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtk.js issue with the ES6 example

Sebastien Jourdain-2
Which version of vtk.js are you using? Looking at the code (now 6.6.5), it seems that the missing rule exist.

On Thu, Jun 14, 2018 at 6:59 AM Sebastien Jourdain <[hidden email]> wrote:
Good catch, I'll update the code, but the missing loader would be https://github.com/Kitware/vtk-js/blob/master/Utilities/config/rules-tests.js#L5-L10 and that should be part of the vtk rules.

Thanks for reporting the issue.

Seb

On Thu, Jun 14, 2018 at 3:38 AM smurphy <[hidden email]> wrote:
Hello,

I am having issues with running the vtk.js example from
https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html.

I did exactly as instructed (at least I believe I did and cross-checked many
times).

when running
>npm run build
I get the following error

ERROR in
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl
Module parse failed: Unexpected token (18:10)
You may need an appropriate loader to handle this file type.

The entire output until this error is copied below. I also attach the
webpack.config.js file.

Tried searching online and in the forum but can't find any solutions to this
specific problem.

Thanks,
Sebastien

> mywebproject@1.0.0 build ~/VTK/Web/MyWebProject
> webpack

Hash: a6f352cb63b054c23d33
Version: webpack 4.8.3
Time: 1959ms
Built at: 2018-06-14 11:29:58
 1 asset
Entrypoint main = main.js
 [2] (webpack)/buildin/amd-define.js 88 bytes {0} [built]
 [4] (webpack)/buildin/amd-options.js 82 bytes {0} [built]
 [5] (webpack)/buildin/module.js 519 bytes {0} [built]
 [6] (webpack)/buildin/global.js 509 bytes {0} [built]
[10] ./src/controller.html 158 bytes {0} [built] [failed] [1 error]
[20] ./src/index.js + 98 modules 904 KiB {0} [built]
     | ./src/index.js 2.59 KiB [built]
     |     + 98 hidden modules
[21] crypto (ignored) 15 bytes {0} [optional] [built]
    + 25 hidden modules

WARNING in ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
1293:25-47 "export 'default' (imported as 'ComputeGradientsWorker') was not
found in './ComputeGradients.worker'
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js
 @ ./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js
 @
./node_modules/vtk.js/Sources/Rendering/Misc/FullScreenRenderWindow/index.js
 @ ./src/index.js

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production'
for this value. Set 'mode' option to 'development' or 'production' to enable
defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more:
https://webpack.js.org/concepts/mode/

ERROR in
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl
Module parse failed: Unexpected token (18:10)
You may need an appropriate loader to handle this file type.
|
=========================================================================*/



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtk.js issue with the ES6 example

smurphy
Hi,
I'm using vtk version 6.6.1. (Below is my package.json)

{
  "name": "mywebproject",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "dependencies": {
    "kw-web-suite": "^6.1.0",
    "vtk.js": "^6.6.1"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
    "scripts": {
        "build": "webpack",
        "build:release": "webpack -p",
        "start": "webpack-dev-server --content-base ./dist",        
        "commit": "git cz",
        "semantic-release": "semantic-release"
    },
  "author": "Seb",
  "license": "ISC"
}




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtk.js issue with the ES6 example

smurphy
Ok I updated to 6.6. 5 (package.json below) but I still have the same problem
as before..
Thanks

{
  "name": "mywebproject",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "dependencies": {
    "vtk.js": "^6.6.5"
  },
  "devDependencies": {
    "kw-web-suite": "^6.1.0"
  },
  "scripts": {
    "build": "webpack",
    "build:release": "webpack -p",
    "start": "webpack-dev-server --content-base ./dist",
    "commit": "git cz",
    "semantic-release": "semantic-release"
  },
  "author": "Seb",
  "license": "ISC"
}



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtk.js issue with the ES6 example

Sebastien Jourdain-2
Ok, I'll try the process from scratch to make sure we are not missing anything in the documentation.

On Thu, Jun 14, 2018 at 8:47 AM smurphy <[hidden email]> wrote:
Ok I updated to 6.6. 5 (package.json below) but I still have the same problem
as before..
Thanks

{
  "name": "mywebproject",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "dependencies": {
    "vtk.js": "^6.6.5"
  },
  "devDependencies": {
    "kw-web-suite": "^6.1.0"
  },
  "scripts": {
    "build": "webpack",
    "build:release": "webpack -p",
    "start": "webpack-dev-server --content-base ./dist",
    "commit": "git cz",
    "semantic-release": "semantic-release"
  },
  "author": "Seb",
  "license": "ISC"
}



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtk.js issue with the ES6 example

smurphy
Hi again,

I had a naming issue with the webpack.config.js file (I had called it
wepack.config.js forgetting the "b"). Stupid mistake.

So the example works fine.

Thanks a lot for the help,



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers