question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<Spin /> error when compiling css

See original GitHub issue

For some reason, if I include the ‘Spin’ component on my page, I get a webpack compiling error:

ERROR in ./~/antd/lib/spin/style/index.css
Module build failed: Error
    at NormalModule.onModuleBuildFailed (/code/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19)
    at nextLoader (/code/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31)
    at /code/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15
    at context.callback (/code/node_modules/webpack-core/lib/NormalModuleMixin.js:148:14)
    at /code/node_modules/less-loader/index.js:68:16
    at /code/node_modules/less/lib/less/render.js:26:35
    at /code/node_modules/less/lib/less/parse.js:62:33
    at ImportVisitor.finish [as _finish] (/code/node_modules/less/lib/less/parser/parser.js:180:28)
    at ImportVisitor._onSequencerEmpty (/code/node_modules/less/lib/less/visitors/import-visitor.js:35:14)
    at ImportSequencer.tryRun (/code/node_modules/less/lib/less/visitors/import-sequencer.js:50:14)
 @ ./app/stores/StoreList.jsx 7:14-44
Child extract-text-webpack-plugin:
    chunk    {0} extract-text-webpack-plugin-output-filename 1.78 kB
        [0] ./~/css-loader!./~/postcss-loader!./~/less-loader!./app/styles/Notes.less 277 bytes {0} [built]
         + 1 hidden modules
Child extract-text-webpack-plugin:
    
    ERROR in ./~/css-loader!./~/postcss-loader!./~/less-loader!./~/antd/lib/spin/style/index.css
    Module build failed: Unrecognised input
     @ /code/node_modules/antd/lib/spin/style/index.css (line 71, column 24)
     near lines:
         /* IE6~IE9 */
         -webkit-filter: progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false);
                 filter: progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false);
webpack: Failed to compile.
GET /stores 200

I assume it has something to do with the progid IE9 rules.

Now, so far my other components work fine.

I suppose I could fix this with some sort of webpack configuration tweak ?

btw, my current webpack configuration looks like this:

{
	test: /(\.less|\.css)$/,
	loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!less-loader'),
},

Please note that so far this is the only component causing this issue.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
benjycuicommented, Feb 22, 2017

@coljung try to separate less’s config and css’s config.

See: https://github.com/coljung/help-test/blob/master/antd-repo-help/ui-store/webpack.config.js#L35

You are using less-loader to process CSS, and it seems that less-loader doesn’t support this syntax:

filter: progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false);
5reactions
coljungcommented, Feb 23, 2017

Yes, the problem is that i’ve tried to replicate the config from atool-build, and i get webpack error everytime.

If i use this:

{
	test: /\.css$/,
	loader: ExtractTextPlugin.extract(
        `${require.resolve('css-loader')}` +
        `?sourceMap&-autoprefixer!${require.resolve('postcss-loader')}`),
},
{
	test: /\.less$/,
	loader: ExtractTextPlugin.extract(
        `${require.resolve('css-loader')}?sourceMap&-autoprefixer!` +
        `${require.resolve('postcss-loader')}!` +
        `${require.resolve('less-loader')}?{"sourceMap":true,"modifyVars":${JSON.stringify(theme)}}`),
},

I get this errors when trying to run webpack:

image

I’ve tried modifying the above script multiple times, but i havent been able to find the right setup to compile properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am gettiing an error expected new line while compiling SASS
scss to compile your file by SCSS compile option. I've used sass dart. sass \source\style1.scss \result\style1.css.
Read more >
I can't get the spin to work for some reason. - Codecademy
I can't get the spin to work for some reason. Keep getting the error: 'Missing standard property 'transform' to go along with '-webkit-transform'.”...
Read more >
Magento 2 less compilation error while setup:static-content ...
0 I am facing issue in compiling less and css files. The files styles-l.css and styles-m.css are missing - not generated. During static...
Read more >
I am having this error while compiling my scss cod. Please ...
I was trying to compile my scss code through command prompt, but it shows invalid. I don't know why this happening, Can anyone...
Read more >
More, a CSS compiler - Kevin Montrose
More is aware of the CSS3 @keyframes directive, and gives you all the same mixin and variable tools to build them. ... It...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found