Reputation: 4967
I'm setting up some react/webpack/webpack-dev-server boilerplate for trying things out, but running into a render error.
The code in question comes from the "Thinking in React" Facebook.io page; here's the part which is failing:
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App';
ReactDOM.render(
<div>
<App />
</div>,
document.getElementById('app')
);
When I start the webpack-dev-server, I'm getting the following webpack build error:
My package.json & webpack.config.js are in this gist.
I've modified the boilerplate from the SurviveJS configuration to support Jasmine for testing and I have it working in the app from the book, but cannot figure out why it's failing here.
I've tried things like surrounding the first parameter to ReactDOM with parentheses but haven't found a solution. I've diff'd the package.json and webpack.config.js between the two apps and don't see any differences except the title.
At this point, I have no idea what to look for, although I'm convinced it's probably something braindead obvious -- I've just been looking at it too long, so any pointers would be much appreciated.
Thanks!
Upvotes: 0
Views: 254
Reputation: 62813
Do you have a .babelrc
in place? It looks like JSX isn't getting transpiled.
Upvotes: 2