KitwareMedical / vtk.js-examples

These are a few examples for vtk.js
28 stars 21 forks source link

Webpack dev server #3

Closed MHadavand closed 3 years ago

MHadavand commented 3 years ago

Trying to run webpack dev server using the same config from the repository and get this error

Cannot find module 'webpack-cli/bin/config-yargs

Changing the webpack version is a recommended solution but I get compatibility issues with kw-web-suite

floryst commented 3 years ago

Quickest solution is to run "npm install -D webpack-cli @webpack/serve", and then replace the script "webpack-dev-server" with "webpack serve" in package.json.

I'll update the examples for webpack 5 and latest kw-web-suite. Thanks for the report!

On December 16, 2020 8:20:44 PM UTC, Mostafa Hadavand notifications@github.com wrote:

Trying to run webpack dev server using the same config from the repository and get this error

Cannot find module 'webpack-cli/bin/config-yargs

Changing the webpack version is a recommended solution but I get compatibility issues with kw-web-suite

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/KitwareMedical/vtk.js-examples/issues/3

MHadavand commented 3 years ago

Thanks a lot! I had changed it to webpack serve and even installed webpack-cli but in order to get it to work, I had to delete node_moudles and the package-lock and reinstall dependencies. It is working now.

One other thing to add to the course material is the issue with passing variables from npm scripts on Windows. I had to install cross-env to get it work and use

"cross-env EXAMPLE=cone.js webpack serve --mode=development"

Cheers,

floryst commented 3 years ago

Thanks for the windows tip! I'll add it into the docs.