gem-mine / webpack-css-themes-plugin

7 stars 2 forks source link

Error: Didn't get a result from child compiler #4

Closed itayganor closed 4 years ago

itayganor commented 4 years ago

When I try to import another file from a .less file, I receive the following error:

ERROR in ./src/index.less
Module build failed (from (webpack)-css-themes-plugin/src/loader/index.js):
ModuleBuildError: Module build failed (from (webpack)-css-themes-plugin/src/loader/index.js):
Error: Didn't get a result from child compiler

Reproduction: https://github.com/itayganor/webpack-css-themes-plugin-reproduction

run start or build-dev.

To get rid of the message, remove the line:

@import './assets/fonts/Lato/Lato.css';

from ./client/src/index.less, and it will work.

Any idea why?

githoniel commented 4 years ago

we can'not import css in less file now, change Lato.css => Lato.less to make it work temporary

I will fixed it later

itayganor commented 4 years ago

Thanks! The same issue happens when I try to import *.module.less :/ Do you have any direction for solving it? I might try too

githoniel commented 4 years ago

@itayganor after investigate I found you should import css file in less by

@import (less) './assets/fonts/Lato/Lato.css';

does this also resolve your *.module.less problem?

itayganor commented 4 years ago

@itayganor after investigate I found you should import css file in less by

@import (less) './assets/fonts/Lato/Lato.css';

does this also resolve your *.module.less problem?

Yes, it does. Awesome.

Can this be forced through the plugin? (add (less) when it's not there)

githoniel commented 4 years ago

import css directly in less is not support by less but it did support in webpack without this plugin.

auto add (less) seem a little hack and will need some work, sorry I won't support it currently