Search code examples
reactjsreact-day-picker

loader issue with react-day-picker


While using react-day-picker, i get the following error:

You may need an appropriate loader to handle this file type.  
| /* DayPicker styles */ |  
 | .DayPicker { | display: -webkit-box; |  

display: -ms-flexbox; @  
 ./src/components/portfolio/RecordInvestorDetail.react.js 47:0-41  

Module parse failed: /home/yash/Documents/CRONJ/waccal/node_modules/react-day-picker/lib/style.css Line 3: Unexpected token .

_

enter image description here


Solution

  • I resolved the error by adding

    loaders : [
    'style',
    ]
    

    I already had

    loaders : [
              'style-loader',
              'css-loader',
              'autoprefixer?browsers=last 2 version',
              'sass-loader?includePaths[]=' + paths.src('styles')
            ]
    

    Now the loaders are

    loaders : [
              'style',
              'style-loader',
              'css-loader',
              'autoprefixer?browsers=last 2 version',
              'sass-loader?includePaths[]=' + paths.src('styles')
            ]