When I try to import a .less
from my React component I get the following error:
Module not found: '[object Object]' in /path/to/src
Here's a part of my webpack config that's taking care of css and less loading:
...
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: true,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
},
'postcss-loader'
]
})
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
sourceMap: true,
importLoaders: true,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
},
'less-loader'
]
})
},
...
In my component, I'm importing the .less
style file, like so:
import styles from './App.less'
I've tried reading related github issues and been debugging this for a while. Would love some help!