Open chinds185a opened 8 years ago
Hi,
i encountered the same problem. I figured that the precompiling was not able to recognize the JSX Syntax. To fix this i explicitly defined all the babel plugins specified in the package.json inside the webpack loader.
In webpack.config.development.js change
config.module.loaders = config.module.loaders.concat([
{test: /\.jsx?$/, loaders: [ 'react-hot', 'babel'], exclude: /node_modules/}
]);
to
config.module.loaders = config.module.loaders.concat([
{
test: /\.jsx?$/,
loaders: [ 'react-hot', 'babel?presets[]=es2015&presets[]=react&presets[]=stage-0'],
exclude: /node_modules/
}
]);
same in webpack.config.production.js just without the hotloading.
config.module.loaders = config.module.loaders.concat([
{test: /\.jsx?$/, loaders: [ 'babel'], exclude: /node_modules/}
]);
to
config.module.loaders = config.module.loaders.concat([
{
test: /\.jsx?$/,
loaders: [ 'babel?presets[]=es2015&presets[]=react&presets[]=stage-0'],
exclude: /node_modules/
}
]);
I am not sure if babel will use a .babelrc file with webpack as I never tested it. If so this could also be resolved with a single .babelrc
{
"plugins": ["es-2015", "react", "stage-0"]
}
EDIT: Just tested the .babelrc Version. It Works and is IMO the cleaner method
@jbultmann What was the setup for the .babelrc version? Thanks
Seems too many errors to make this a usable boiler-plate next!
Hi, I have run through the
npm install
which succeeded then when I rannpm start
i was presented with the error see in the attached image. The server did start but the browser console also complains that it cannot find./client/main.jsx
I am running node 6.5 and npm 3.10.3
Chrome console error: