title: "ERROR in loader Users/abc/node_modules/babel-core/index.js?{"presets":["react"]} didn't return a function "
body: <p>When I'm doing webpack I'm getting into this error:</p>
  
  <pre><code>ERROR in loader Users/abc/node_modules/babel-core/index.js?{"presets":["react"]} didn't return a function
  </code></pre>
  
  <p>webpack.config.js</p>
  
  <pre><code>module.exports = {
    entry: './src/main.js',
    output: {
      filename: 'bundle.js',
      path: __dirname + '/dist'
    },
    module: {`enter code here`
      loaders: [
        {
          test: /\.jsx?$/,
          exclude: /(node_modules|bower_components)/,
          loader: 'babel-core',
          query: {
                 presets: ['react']
              }
        }
      ]
    }
  };
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;React JSX (Precompiled) demo&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="mycontainer"&gt;&lt;/div&gt;
          &lt;script src="./dist/bundle.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>main.js</p>
  
  <pre><code>var React = require('react');
  var ReactDOM = require('react-dom');
  
  var ReactComponent = React.createClass({
    render : function(){
    return(  &lt;div&gt;
      &lt;h1&gt;Welcome to React Js! &lt;/h1&gt;
      &lt;/div&gt;
    );
    }
  });
  
  ReactDOM.render(&lt;ReactComponent/&gt;,document.getElementById('mycontainer'));
  </code></pre>
  
  <p>package structure :</p>
  
  <pre><code>app 
    |
    |-src
     |
     |-main.js
    |-index.html
    |-webpack-config.js
  </code></pre>