css-loader doesn't work anymore with v0.15.1
after updated to v0.15.1 from v0.14.x, css loader doesn't work any more.

here is the config:
const sassLoaders = [
"css",
"sass?" + ["outputStyle=expanded",
"includePaths[]=" + nodeModulesPath,
"includePaths[]=" + bowerComponentsPath].join("&")
].join("!");
later on
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style-loader", sassLoaders, {
publicPath: './'
})
},
I've noticed in file /node_modules/css-loader/lib/processCss.js, wether I use sourcemap or not, the variable inputMap is always string null.. and it crashes postcss.
var result = pipeline.process(inputSource, {
from: options.from,
to: options.to,
map: {
prev: inputMap,
sourcesContent: true,
inline: false,
annotation: false
}
});
so the final way I do for now is modify file /node_modules/css-loader/lib/loader.js, at line 17, detect if map is not null before stringify it
if(map && typeof map !== "string") {
map = JSON.stringify(map);
}
with this hack, it works without map....
Confirmed.
Same issue here.
The solution above works for me as well.
same issue. Here is my stack (slightly different)
ERROR in /usr/local/lib/~/css-loader!/usr/local/lib/~/sass-loader?outputStyle=expanded!./src/client/style/index.scss
Module build failed: TypeError: Cannot read property 'sections' of null
at new SourceMapConsumer (/usr/local/lib/node_modules/css-loader/node_modules/postcss/node_modules/source-map/lib/source-map/source-map-consumer.js:23:21)
at PreviousMap.consumer (/usr/local/lib/node_modules/css-loader/node_modules/postcss/lib/previous-map.js:37:34)
at new Input (/usr/local/lib/node_modules/css-loader/node_modules/postcss/lib/input.js:42:28)
at parse (/usr/local/lib/node_modules/css-loader/node_modules/postcss/lib/parse.js:17:17)
at new LazyResult (/usr/local/lib/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:54:47)
at Processor.process (/usr/local/lib/node_modules/css-loader/node_modules/postcss/lib/processor.js:30:16)
at processCss (/usr/local/lib/node_modules/css-loader/lib/processCss.js:168:24)
at Object.module.exports (/usr/local/lib/node_modules/css-loader/lib/loader.js:21:15)
@ ./src/client/style/index.scss 4:14-225 13:2-17:4 14:20-231
Thanks! Your fix works for me
Confirmed. I simply downgraded to 0.14x instead of modifying library code.
Same here, fix works.
I have the same problem..
same here. I get it from extract-text-plugin which requires any latest version.
ERROR in ./~/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!./~/style-loader!./~/css-loader!./~/sass-loader?outputStyle=expanded!./~/bootstrap-sass-loader/bootstrap-sass-styles.loader.js!./bootstrap-sass.config.js
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'sections' of null
at new SourceMapConsumer (/quran/node_modules/css-loader/node_modules/postcss/node_modules/source-map/lib/source-map/source-map-consumer.js:23:21)
at PreviousMap.consumer (/quran/node_modules/css-loader/node_modules/postcss/lib/previous-map.js:37:34)
at new Input (/quran/node_modules/css-loader/node_modules/postcss/lib/input.js:42:28)
at Object.parse [as default] (/quran/node_modules/css-loader/node_modules/postcss/lib/parse.js:17:17)
at new LazyResult (/quran/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:54:42)
0.14x works for me. Been debugging this all day.. : - (
Same here. Reverted to 0.14.5.
+1 0.15 breaks for me, downgraded to 0.14
also adding sourceMap parameter seems to work see here http://stackoverflow.com/questions/30932592/sass-loader-not-working-in-webpack
+1 same issue
+1, downgrading the dependency to "~1.4.0" fixed the issue for me.
new version (v0.15.2) still has this problem.....
+1, same here
yes same issue
+1 same issue