How to fix Undefined: Property error setTargetNode

I am currently compiling my react project, and it compiles successfully however upon loading the page i get this error:

Uncaught (in promise) TypeError: Cannot read property 'setTargetNode' of undefined
at p (Target.js:40)
at Ba (react-dom.production.min.js:5029)
at Ha (react-dom.production.min.js:5123)
at react-dom.production.min.js:5975
at Object.t.unstable_runWithPriority (scheduler.production.min.js:274)
at Au (react-dom.production.min.js:5974)
at ju (react-dom.production.min.js:5958)
at Pu (react-dom.production.min.js:5925)
at Su (react-dom.production.min.js:5860)
at react-dom.production.min.js:5761

The target.js I believe is a file from the react-popper node module. Which was working prior to updating the package file. The page loads all elements on the page load then the page goes totally blank.

I have tried deleting my package-locked.json and formed a new one however the issue still persists. The project however works fine in the dev environment.

My package.json file:

{
  "name": "compscout-sales",
  "version": "0.1.0",

  "private": true,

  "dependencies": {

    "@coreui/coreui": "^2.1.7",

    "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0",

    "@coreui/icons": "0.3.0",

    "@coreui/react": "^2.1.5",

    "axios": "^0.18.0",

    "body-parser": "^1.19.0",

    "bootstrap": "^4.3.1",

    "bootstrap-less": "^3.3.8",

    "chart.js": "^2.7.3",

    "classnames": "^2.2.6",

    "cookie-parser": "~1.4.3",

    "core-js": "^2.6.5",

    "cors": "^2.8.5",

    "debug": "~2.6.9",

    "dotenv": "^8.0.0",

    "enzyme": "^3.9.0",

    "enzyme-adapter-react-16": "^1.10.0",

    "exceljs": "^0.8.2",

    "express": "~4.16.0",

    "express-rate-limit": "^3.5.1",

    "flag-icon-css": "^3.3.0",

    "font-awesome": "^4.7.0",

    "http": "0.0.0",

    "http-errors": "~1.6.2",

    "https": "^1.0.0",

    "jade": "~1.11.0",

    "jquery": "^3.4.1",

    "jsonwebtoken": "^8.5.1",

    "moment": "^2.24.0",

    "morgan": "~1.9.0",

    "node-sass": "^4.11.0",

    "pg-promise": "^8.6.5",

    "prop-types": "^15.7.2",

    "ramda": "^0.26.1",

    "react": "^16.8.4",

    "react-apollo": "^2.5.6",

    "react-app-polyfill": "^0.2.1",

    "react-chartjs-2": "^2.7.4",

    "react-cookie": "^4.0.0",

    "react-dates": "^20.2.0",

    "react-dom": "^16.8.4",

    "react-js-pagination": "^3.0.2",

    "react-loadable": "^5.5.0",

    "react-redux": "^7.0.3",

    "react-router-config": "^4.4.0-beta.6",

    "react-router-dom": "^4.3.1",

    "react-select": "^2.4.3",

    "react-stripe-checkout": "^2.6.3",

    "react-stripe-elements": "^3.0.0",

    "react-test-renderer": "^16.8.4",

    "reactstrap": "^7.1.0",

    "redux": "^4.0.1",

    "redux-logger": "^3.0.6",

    "redux-thunk": "^2.3.0",

    "request": "^2.88.0",

    "sequelize": "^5.8.7",

    "simple-line-icons": "^2.4.1",

    "stripe": "^6.34.0",

    "xlsx": "^0.11.19"

  },

  "devDependencies": {

    "react-scripts": "2.1.5"

  }, 

  "scripts": {

    "start": "react-scripts start",

    "start:server": "node ./server/www",

    "build": "react-scripts build",

    "test": "react-scripts test",

    "eject": "react-scripts eject"

  },

  "eslintConfig": {

    "extends": "react-app"

  },

  "browserslist": {

    "production": [

      ">0.2%",

      "not dead",

      "not op_mini all"

    ],

    "development": [

      "last 1 chrome version",

      "last 1 firefox version",

      "last 1 safari version"

    ]

  }

}

Thanks


what does package.json has to do with the described error? Read the error again, it describes exactly what is wrong: inside the file Target.js you are trying to access a property called setTargetNode of some object, and that object happened to be undefined when the code reached that point. it even points you to the exact line: (Target.js:40).

Go there, follow the flow of data to that object- where it is created / initialized? are you sure it is initialized before the access to setTargetNode is happening? try it yourself first, if still no success please post the code related to the error so we can better help.

TypeError: Cannot read property 'setTargetNode' of , Steps to reproduce the problem Install reactstrap 6.1.0 run application it will show above error in the  Reproduction demo Cant reproduce this issue in code sandbox as react-popper is used as dependency. Steps to reproduce the problem Create react application using create-react-app Install reactstrap 6.1.0 package run command npm start to r


i had the same problem recently. this was resolved when i used an old package-lock.json. i think it was caused by some dependency packages. maybe "electron-to-chromium" or "timers-browserify" Hope this would help you.

Uncaught TypeError: Cannot read property of undefined In , Steps to reproduce the problem Create react application using create-react-app Install reactstrap 6.1.0  As a result, the following piece of code will result in an “Undefined property” notice: PHP. $person = new Person();echo $person->name; 1. 2. $person=newPerson(); echo$person->name; To fix this, we will obviously need to use the setNamefunction before we attempt to access Person::$name: PHP.


@qasim12321 I'm having the same issue now, were you able to get this fixed?

Avoiding those dang cannot read property of undefined errors, If you get undefined error, you need to make sure that which ever variables Hope this solves a bit of your problem. Running a script with the target set to node when bundling with webpack produces the following error: TypeError: Path must be a string. Received undefined at assertPath (path.js:28:11) at Object.di


Promise cannot read property get of undefined, The dreaded error we all hit at some point in JavaScript development. Could be an empty. undefined. ​​Oh no! To fix this, we'll need to similarly copy each of the nested objects. ​​ Script error, "unable to get property 'left' of undefined or null reference"? What is causing it and how do I fix it!?? What is causing it and how do I fix it!?? This thread is locked.


uncaught typeerror cannot read property offsetwidth of undefined , javascript - Error: Uncaught (in promise): TypeError: Cannot read property reactjs - How to fix Undefined: Property error setTargetNode - Stack Overflow  After the Windows 10 Insider update my watchfire ignite program started to open a script error, specifically: The value of the property "Show Status" is null or undefined, not a Function object. Is there any fix, I am unable to get rid of rendering app


React/Redux Render Error: 'TypeError: Cannot read property , chartjs not drawing with formated time for x axis stack, how to fix uncaught typeerror in drupal 8 core how to fix undefined property error settargetnode stack . If I set target: "node" in webpack.config.js, it would show Uncaught ReferenceError: require is not defined. The reason is bindings.js has var fs=require("fs") . In Webpack , by setting target:"node" , it will not pack fs and require .