How to solve this issue in the react app saying Module parse failed: Unexpected token you may need an appropriate loader to handle this file type?

Viewed 113

I installed a sample react app which i guess was pretty old.

And i faced this error when i tried npm start

./node_modules/react-github-btn/index.js

Module parse failed: Unexpected token (10:83)

You may need an appropriate loader to handle this file type.

  }
   render () {
     return React.createElement('span', { ref: this.$ }, React.createElement('a', { ...this.props, ref: this._ }, this.props.children))
   }
   componentDidMount () {

I figured out it might be with my package.json. But i don't get it. What's wrong with it?

{
  "name": "meme-marketplace",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "@textile/hub": "^0.1.7",
    "@textile/threads-core": "^0.1.24",
    "ethereumjs-tx": "^2.1.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-dropzone": "^11.0.1",
    "react-github-btn": "^1.2.0",
    "react-redux": "^7.2.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^1.1.5",
    "react-simple-flex-grid": "^1.3.21",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "web3": "^1.2.9"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
   "not dead",
   "not op_mini all"
 ]
}
0 Answers
Related