css module not being read: Syntax Error
<p>Here is a component importing css...</p>

<pre><code>import React from 'react';
import styles from './sample.css';

class Index extends React.Component {

    render(){
        return (
            &lt;div&gt;

                &lt;div className="${styles.bodywrap}"&gt;&lt;/div&gt;

            &lt;/div&gt;

        );
    }
}

export default Index;
</code></pre>

<p>My stylesheet <code>sample.css</code> is the following...</p>

<pre><code>.bodywrap {
    color:red;
}
</code></pre>

<p>But when I run the web app I get the following error...</p>

<pre><code>SyntaxError: C:/Users/Eric/Desktop/tutorHub/components/index_components/sample.c
ss: Unexpected token (1:0)
&gt; 1 | .bodywrap {
    | ^
  2 |   color:red;
  3 | }
</code></pre>

<p>I followed the instuctions to setup css modules, so my webpack.config looks as follows...</p>

<pre><code>var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    devtool: 'cheap-module-eval-source-map',
    entry: "./main.js",
    output: {
        path: '/',
        filename: 'index.js'
     },
    module: {
         loaders: [
            {
                test: /\.js$/,
                loader: 'babel',
                exclude: /node_modules/,
                query:{
                     presets: ['es2015','react'],
                }
            },
            {
         test: /\.css/,
         loader: ExtractTextPlugin.extract('css?modules&amp;importLoaders=1&amp;localIdentName=[name]__[local]___[hash:base64:5]')
      }


        ]
    },

    plugins: [
        new ExtractTextPlugin("styles.css"),
        new webpack.optimize.OccurrenceOrderPlugin()
     ]
 };
</code></pre>

<p>Any idea why my CSS is not being read properly? Do I need something to convert the code so it is recognized properly?</p>

<p>EDIT</p>

<p>I think its important to node that I'm rendering the component above through the server using node js...</p>

<pre><code>var express = require('express');
var router = express.Router();
var React = require('react');
var reactDom = require('react-dom/server');
var App = React.createFactory(require('../components/index'));
var MasterLayout = React.createFactory(require('../master/links'));

router.get('/', function(req,res) {
    var reactHtml = reactDom.renderToString(App({}));
    var styles = reactDom.renderToString(MasterLayout({}));
    res.render('../../tutorHub/index.jade', {reactOutput: reactHtml, links: styles});

});
</code></pre>

<p>Can this be interfering with the css?</p>