<div dir="ltr">Do you see the difference between the documentation doing this:<div><br></div><div><pre style="box-sizing:inherit;margin:0px;padding:0px;border:none;outline:0px;font-family:"Source Code Pro",Monaco,Menlo,Consolas,monospace;font-size:0.95em;vertical-align:baseline;color:rgb(77,77,76);background:none rgb(238,238,238);line-height:22px;text-align:left;text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"><span class="gmail-keyword" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(137,89,168)">var</span> vtkRules = <span class="gmail-built_in" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(245,135,31)">require</span>(<span class="gmail-string" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(113,140,0)">'vtk.js/Utilities/config/dependency.js'</span>).webpack.v2.rules;</span><br style="box-sizing:inherit"></pre>[...]</div><div><pre style="box-sizing:inherit;margin:0px;padding:0px;border:none;outline:0px;font-family:"Source Code Pro",Monaco,Menlo,Consolas,monospace;font-size:0.95em;vertical-align:baseline;color:rgb(77,77,76);background:none rgb(238,238,238);line-height:22px;text-align:left;text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"><span class="gmail-built_in" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(245,135,31)">module</span>: {</span><br style="box-sizing:inherit"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"> rules: [</span><br style="box-sizing:inherit"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"> { <span class="gmail-attr" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline">test</span>: entry, <span class="gmail-attr" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline">loader</span>: <span class="gmail-string" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(113,140,0)">"expose-loader?MyWebApp"</span> },</span><br style="box-sizing:inherit"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"> { <span class="gmail-attr" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline">test</span>: <span class="gmail-regexp" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(200,40,41)">/\.html$/</span>, <span class="gmail-attr" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline">loader</span>: <span class="gmail-string" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;color:rgb(113,140,0)">'html-loader'</span> },</span><br style="box-sizing:inherit"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"> ].concat(vtkRules),</span><br style="box-sizing:inherit"><span class="gmail-line" style="box-sizing:inherit;margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:14.25px;vertical-align:baseline;height:22px"> },</span></pre><br></div><div><br></div><div>versus what you are doing below?</div><div><br></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">const vtkRules = require('./Utilities/config/ru</span><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">les-vtk.js');</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">const linterRules = require('./Utilities/config/ru</span><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">les-linter.js');</span><br></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[...]</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">module: {</span><br style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> rules: [</span><br style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> { test: entry, loader: 'expose-loader?vtk' },</span><br style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> ].concat(linterRules, vtkRules),</span><br style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> },</span><br></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The big difference in those two is the way the rules are defined to interpret specific files (glsl, WebWorkers...).</span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">In your case (taken from vtk.js webpack) you use rules that expect the vtk.js files to be in ./Sources/** while in the top case we expect to find the vtk.js files under ./node_modules/vtk.js/Sources/** as you are going to use vtk.js as a dependency not as a first class citizen of your project.</span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">HTH,</span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Seb</span></span></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 26, 2018 at 7:16 AM marf <<a href="mailto:marvin.huber@basf.com">marvin.huber@basf.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, I'm trying to use vtk.js and angular together in a project and was<br>
just trying to get a basic setup running for now, but sadly whenever I try<br>
to build my project through <br>
npm run start<br>
it fails with the following errors, could anybody help me? I'm lost and<br>
couldn't really find anything. My guess would be that my webpack config is<br>
incomplete or anything, so I'll add that, too. But even if the error is in<br>
there, my knowledge in that topic is far to vague to figure the issue out<br>
myself.<br>
<br>
<br>
<br>
Error:<br>
<br>
WARNING in ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js<br>
1293:25-47 "export 'default' (imported as 'ComputeGradientsWorker') was not<br>
found in './ComputeGradients.worker.js'<br>
<br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl<br>
Module parse failed: Unexpected token (18:10)<br>
You may need an appropriate loader to handle this file type.<br>
|<br>
=========================================================================*/<br>
| <br>
| attribute vec4 vertexDC;<br>
| <br>
| varying vec3 vertexVCVSOutput;<br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl<br>
Module parse failed: Unexpected token (18:10)<br>
You may need an appropriate loader to handle this file type.<br>
|<br>
=========================================================================*/<br>
| <br>
| attribute vec4 vertexMC;<br>
| <br>
| // frag position in VC<br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkSphereMapperVS.glsl<br>
Module parse failed: Unexpected token (19:10)<br>
You may need an appropriate loader to handle this file type.<br>
| // this shader implements imposters in OpenGL for Spheres<br>
| <br>
| attribute vec4 vertexMC;<br>
| attribute vec2 offsetMC;<br>
| <br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkStickMapperVS.glsl<br>
Module parse failed: Unexpected token (19:10)<br>
You may need an appropriate loader to handle this file type.<br>
| // this shader implements imposters in OpenGL for Sticks<br>
| <br>
| attribute vec4 vertexMC;<br>
| attribute vec3 orientMC;<br>
| attribute vec4 offsetMC;<br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl<br>
Module parse failed: Unexpected token (19:8)<br>
You may need an appropriate loader to handle this file type.<br>
| // Template for the polydata mappers fragment shader<br>
| <br>
| uniform int PrimitiveIDOffset;<br>
| <br>
| // VC position of this fragment<br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS2.glsl<br>
Module parse failed: Unexpected token (22:8)<br>
You may need an appropriate loader to handle this file type.<br>
| //VTK::Output::Dec<br>
| <br>
| varying vec3 vertexVCVSOutput;<br>
| <br>
| // camera values<br>
ERROR in<br>
./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl<br>
Module parse failed: Unexpected token (22:8)<br>
You may need an appropriate loader to handle this file type.<br>
| //VTK::Output::Dec<br>
| <br>
| varying vec3 vertexVCVSOutput;<br>
| <br>
| // camera values<br>
<br>
<br>
<br>
webpack.config.js (I really didn't change anything in here since I barely<br>
get what the stuff is for... also this website didn't help me either:<br>
<a href="https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html" rel="noreferrer" target="_blank">https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html</a> )<br>
<br>
const webpack = require('webpack');<br>
const path = require('path');<br>
<br>
const entry = path.join(__dirname, './Source/index.js');<br>
const sourcePath = path.join(__dirname, './Source');<br>
const outputPath = path.join(__dirname, './dist');<br>
<br>
const vtkRules = require('./Utilities/config/rules-vtk.js');<br>
const linterRules = require('./Utilities/config/rules-linter.js');<br>
<br>
module.exports = {<br>
entry,<br>
output: {<br>
path: outputPath,<br>
filename: 'vtk.js',<br>
libraryTarget: 'umd',<br>
},<br>
module: {<br>
rules: [<br>
{ test: entry, loader: 'expose-loader?vtk' },<br>
].concat(linterRules, vtkRules),<br>
},<br>
resolve: {<br>
modules: [<br>
path.resolve(__dirname, 'node_modules'),<br>
sourcePath,<br>
],<br>
alias: {<br>
'vtk.js': __dirname,<br>
},<br>
},<br>
};<br>
<br>
<br>
<br>
Thank you guys so much in advance<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>