paraviewweb icon indicating copy to clipboard operation
paraviewweb copied to clipboard

Issues with webpack

Open shaolunruan opened this issue 5 years ago • 4 comments

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

Module build failed (from ./node_modules/[email protected]@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\[email protected]@schema-utils\dist\validate.js:50:11)
    at Object.loader (E:\pvw0\node_modules\[email protected]@css-loader\dist\index.js:34:28)
 @ ./node_modules/[email protected]@paraviewweb/style/ComponentNative/Composite.mcss 1:14-174
 @ ./node_modules/[email protected]@paraviewweb/src/Component/Native/Composite/index.js
 @ ./node_modules/[email protected]@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],
        },
      },
    ],

shaolunruan avatar Dec 22 '19 09:12 shaolunruan

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

jourdain avatar Dec 28 '19 11:12 jourdain

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 <[email protected]> Date: Sat,Dec 28,2019 7:14 PM To: Kitware/paraviewweb <[email protected]> Cc: Ryan <[email protected]>, Author <[email protected]> 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.

shaolunruan avatar Dec 28 '19 12:12 shaolunruan

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

jourdain avatar Dec 28 '19 12:12 jourdain

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 <[email protected]> Date: Sat,Dec 28,2019 8:55 PM To: Kitware/paraviewweb <[email protected]> Cc: Ryan <[email protected]>, Author <[email protected]> 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.

shaolunruan avatar Dec 28 '19 13:12 shaolunruan