I am new to react. I a encountering an weired error and this leaves me perplexed! To my understanding nothing wrong in the syntax in index.jsx which is given below.
> 7 | <div>
| ^
My index.js is
import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
render() {
return (
<div>
<p>Hi Russell!!</p>
</div>
);
}
}
ReactDOM.render( <App/>, document.getElementById('app'))
My package.json is
const webpack = require('webpack');
const path = require('path');
var APP_DIR = path.resolve(__dirname, 'src/client/app');
var BUILD_DIR = path.resolve(__dirname, 'src/client/public');
var config = {
entry: APP_DIR + '/index.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?/,
include: APP_DIR,
loader: 'babel-loader'
}
]
}
}
module.exports = config;
I have reviewed every possible part of this. In spite of this, I am not able to figure out what is wrong. It still throws me the error. Any help on how to debug this?
The error pops up when I try to run
webpack -d
If I start by
npm run serve
The browser opens without rendering anything on the page. This leaves me in
Many thanks in advance.