Unable to 'npm run build'


#1

Edit: nevermind, solved myself

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
no exercise

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
ERROR in ./app/index.js
Module build failed: SyntaxError: C:/ReactJS/app/index.js: Unexpected token (5: 16)

5 | ReactDOM.render(, document.getElementById(‘app’)

and when I try to run ‘npm run start’ (ignoring the first error message)
Trailing comma in object at 9:3
},

index.js :

import React from 'react';
import ReactDOM from 'react-dom';
import { App } from './components/App';

ReactDOM.render(
	<App />, 
	document.getElementById('app')
);

App.js : 
import React from 'react';
import ReactDOM from 'react-dom';
export class App extends React.Component {
	render() {
		return (
			<div>
				Hello World!
			</div>
		);
	}
}

package.json : 
{
  "name": "reactjs",
  "version": "1.0.0",
  "description": "install_react",
  "main": "index.js",
  "scripts": {
    "build": "webpack",
    "start": "webpack-dev-server"
  },
  "author": "S7",
  "license": "ISC",
  "dependencies": {
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-react": "^6.24.1",
    "html-webpack-plugin": "^2.30.1",
    "webpack": "^3.5.6",
    "webpack-dev-server": "^2.7.1"
  }
}

#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.