Kitware / paraviewweb

Web framework for building interactive visualization relying on VTK or ParaView to produce visualization data
http://kitware.github.io/paraviewweb/
BSD 3-Clause "New" or "Revised" License
160 stars 50 forks source link

Issues with webpack #505

Open shaolunruan opened 4 years ago

shaolunruan commented 4 years ago

when i first npm start the code. The errer is shown as follows:

Module build failed (from ./node_modules/_css-loader@3.2.0@css-loader/dist/cjs.js):
ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'localIdentName'. These properties are valid:
   object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals? }
    at validate (E:\pvw0\node_modules\_schema-utils@2.5.0@schema-utils\dist\validate.js:50:11)
    at Object.loader (E:\pvw0\node_modules\_css-loader@3.2.0@css-loader\dist\index.js:34:28)
 @ ./node_modules/_paraviewweb@3.2.12@paraviewweb/style/ComponentNative/Composite.mcss 1:14-174
 @ ./node_modules/_paraviewweb@3.2.12@paraviewweb/src/Component/Native/Composite/index.js
 @ ./node_modules/_babel-loader@8.0.6@babel-loader/lib??ref--18-0!./src/index.js
 @ ./src/index.js-exposed

It shows something goes wrong when packing. And then change the code like this, the pkg will be compiled successfully. Previous:

use: [
      { loader: 'style-loader' },
      {
        loader: 'css-loader',
        options: {
          localIdentName: '[name]-[local]_[sha512:hash:base32:5]',
          modules: true,
        },
      },
      {
        loader: 'postcss-loader',
        options: {
          plugins: () => [autoprefixerPlugin],
        },
      },
    ],

Now

use: [
      { loader: 'style-loader' },
      {
        loader: 'css-loader',
        options: {
          modules:{
            localIdentName: '[name]-[local]_[sha512:hash:base32:5]',
          },
          modules: true,
        },
      },
      {
        loader: 'postcss-loader',
        options: {
          plugins: () => [autoprefixerPlugin],
        },
      },
    ],
jourdain commented 4 years ago

Thanks for sharing the solution, but I'm not sure where you ran npm start as we don't have such entry available.

shaolunruan commented 4 years ago

Hi there! This is the original text below at https://kitware.github.io/paraviewweb/docs/setup.html

“Run To build your application you can run npm run build and to test/debug it npm start while opening http://localhost:9999.”

I just followed the cmd at the DOC document. I hope i made everything right throughout the building process. Thx!

发自我的iPhone

------------------ Original ------------------ From: Sebastien Jourdain <notifications@github.com> Date: Sat,Dec 28,2019 7:14 PM To: Kitware/paraviewweb <paraviewweb@noreply.github.com> Cc: Ryan <1072458853@qq.com>, Author <author@noreply.github.com> Subject: Re: [Kitware/paraviewweb] Issues with webpack (#505)

Thanks for sharing the solution, but I'm not sure where you ran npm start as we don't have such entry available.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jourdain commented 4 years ago

I see, indeed for running pvw example we do provide a "start" command. Thanks for refreshing my memory. ;-)

shaolunruan commented 4 years ago

Hah!I didn't do anything actually:) So the error info i provided is an error indeed or it's just a mistake i made. (By the way, I'm afraid it is an update of webpack which u used for bundling the scripts of pvw.) Thx!

发自我的iPhone

------------------ Original ------------------ From: Sebastien Jourdain <notifications@github.com> Date: Sat,Dec 28,2019 8:55 PM To: Kitware/paraviewweb <paraviewweb@noreply.github.com> Cc: Ryan <1072458853@qq.com>, Author <author@noreply.github.com> Subject: Re: [Kitware/paraviewweb] Issues with webpack (#505)

I see, indeed for running pvw example we do provide a "start" command. Thanks for refreshing my memory. ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.