webpack: [NodeJS v.7] Webpack ERROR in Path must be a string. Received undefined

I’m update my node.js to version 7. And after run webpack in project I received error message: ERROR in Path must be a string. Received undefined

My package.json :

"dependencies": {
    "react": "^15.3.1",
    "react-native": "^0.33.0",
    "react-redux": "^4.4.5",
    "react-web": "0.4.5",
    "redux": "^3.6.0",
    "redux-thunk": "^2.1.0",
    "remote-redux-devtools": "^0.4.8"
  },
  "devDependencies": {
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.7",
    "babel-preset-react-native": "^1.9.0",
    "babel-preset-stage-1": "^6.16.0",
    "haste-resolver-webpack-plugin": "^0.2.2",
    "json-loader": "^0.5.4",
    "react-dom": "^15.3.2",
    "react-hot-loader": "^1.3.0",
    "webpack": "^1.13.3",
    "webpack-dev-server": "^1.16.2",
    "webpack-html-plugin": "^0.1.1"
  }

Anybody has a suggestion? How resolve this problem?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 17 (4 by maintainers)

Most upvoted comments

add a key ‘publicPath’ to the webpack config output node

output:{
    publicPath:''
}

Anyone got a solution to this?

As of Node v6.0.0 undefined as an argument to various path methods won’t do. It has to be an (empty) string (https://github.com/nodejs/node/pull/5348).

Probably a loader you’re using is erring on this (there are bug reports concerning this issue all over the place…) (Thus) solution: make sure that instead of undefined an empty string is passed.

--display-error-details

@martindederer were you ever able to correct this problem cause I now have it too. I also found the exact same library as you and I also removed the offending assertPath function, but to no avail.