I've been fighting with webpack for more than a day now to get the source maps up for my scss file loaded through ExtractTextPlugin.
Every time I get the error:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.relative (path.js:538:5)
at Object.onRender (C:\Git\app\node_modules\sass-loader\index.js:282:42)
at Object.<anonymous> (C:\Git\app\node_modules\async\dist\async.js:2244:31)
at Object.callback (C:\Git\app\node_modules\async\dist\async.js:906:16)
at options.success (C:\Git\app\node_modules\node-sass\lib\index.js:303:32)
My webpack config module looks like the following:
{
test: /\.(css)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'})
},
{
test: /\.(scss)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
sourceMap: true
}
},
{
loader: 'sass-loader',
options: {
sourceMap: true
}
}]})
},
My loader versions are: css-loader: 0.28.7 sass-loader: 4.1.1 style-loader: 0.13.2 node-sass: 3.13.1 webpack: 2.2.1 extract-text-webpack-plugin: 2.1.0
When I remove the sourceMap property or remove the property from the string like so:
{
test: /\.(scss)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!sass-loader'})
}
It runs just fine. If i added "?sourceMap" to the end of the loaders, that also breaks the build. From what I keep reading, it looks like it might be a versioning issue but I'm not sure. Any thoughts would be greatly appreciated.