Hi,
I was able to run react projects but now when i try to run it says – to install webpack-cli, i install it but then it says
Error: Minified React error #200;
I searched on the web and since march start many having this problem …
Can any one please guide me …
My webpack.config.js file -
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
const webpack = require('webpack'); //to access built-in plugins
const path = require('path');
const config = {
entry: './app/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index_bundle.js',
publicPath: '/'
},
module: {
rules: [
{ test: /\.(js)$/, use: 'babel-loader' },
{ test: /\.css$/, use: ['style-loader','css-loader'] }
]
},
devServer: {
historyApiFallback: true
},
plugins: [
new HtmlWebpackPlugin({template: './app/index.html'})
]
};
module.exports = config;
My Package.json
{
"name": "reactdata",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"create": "webpack",
"start": "webpack-dev-server --open"
},
"babel": {
"presets": [
"env",
"react"
]
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.18.0",
"prop-types": "^15.6.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-router-dom": "^4.2.2"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.10",
"html-webpack-plugin": "^2.28.0",
"style-loader": "^0.20.3",
"webpack": "^2.3.1",
"webpack-dev-server": "^2.4.2"
}
}
And a very simple react app with index.html having app element–
import React from 'react';
import ReactDom from'react-dom';
require('./index.css');
class App extends React.Component {
render() {
return(
<div>
Hello World
</div>
)
}
}
ReactDom.render(
<App />,
document.getElementById('app')
)