webpack: "TypeError: Path must be a string" after break from project

I updated packages and all seemed fine. I took a week break from the project, ran npm install and cannot seem to figure out the cause of this error. It’s on this repo.

For convenience here is the error message and specs:

ERROR in ./src/app.js
Module build failed: TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1429:5)
    at processText (/home/kingscott/newton/node_modules/standard/node_modules/eslint/lib/cli-engine.js:144:30)
    at CLIEngine.executeOnText (/home/kingscott/newton/node_modules/standard/node_modules/eslint/lib/cli-engine.js:671:26)
    at Linter.lintText (/home/kingscott/newton/node_modules/standard-engine/index.js:65:59)
    at Object.standardLoader (/home/kingscott/newton/node_modules/standard-loader/index.js:19:12)
 @ multi app

and my packages:

"dependencies": {
    "material-ui": "^0.15.0-alpha.2",
    "react": "^15.0.2",
    "react-dom": "^15.0.2",
    "react-tap-event-plugin": "^1.0.0",
    "recompose": "^0.17.0"
  },
  "engines": {
    "node": "0.12.7"
  },
  "devDependencies": {
    "babel": "^5.8.21",
    "babel-core": "^5.8.22",
    "babel-loader": "^5.3.2",
    "standard": "^6.0.8",
    "standard-loader": "^3.0.0",
    "webpack": "^1.13.0",
    "webpack-dev-server": "^1.14.1"
  }

If you check out the repo, you can see my server.js and webpack.config.js.

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 54
  • Comments: 55 (10 by maintainers)

Commits related to this issue

Most upvoted comments

An upgrade to babel-core@6.10.4 may solves the problem. At least this did it im my case.

Must be a node problem. Downgraded to node 5.11.1 and it works. Thanks for the help, you can close.

👍

I’ve seen some weird Node 6 reports so maybe that’s it?

update to babel-core@6.10.4 really help. Thank you

Yeah, downgraded from Node 6.2 to 5.12 and this resolved the issue for me. Thanks!!

@fyllepo It has turned into a party! 🎉

yup! upgrading babel-core works! Thanks everyone 😃

Instead of downgrading node to 5.1.1 as recommended I updated babel-core to @6.10.4 and it worked pretty well!

Thank you!! 🙏🏼

Downgrade node from 6.x to 5.x maybe not a good choice,because we can’t use some new feature in node 6.x then.Upgrade babel-core to the newest version can solve the problem.The newest babel-core is 6.11.4,and it works for me.

Webpack update was the perfect solution for this issue. I’d like just to add a comment on how to update the npm packages easier. You’d need to run the following three commands in your project’s root directory:

npm i -g npm-check-updates npm-check-updates -u npm install

I got it working now after using ncu (npm-check-updates) to fetch the latest versions:

react-redux          ^5.0.5  →  ^5.0.6
eslint-plugin-react  ^7.1.0  →  ^7.2.0
webpack              ^3.5.1  →  ^3.5.2
webpack-dev-server   ^2.7.0  →  ^2.7.1

Node: v8.2.1 NPM: 5.3.0

i meet the same question

➜  ~ node -v
v8.1.0
➜  ~ npm -v
5.0.4

the error message

ERROR in ./app/index.js
Module build failed: TypeError: Path must be a string. Received undefined

and i update my babel-core version to 6.11.4, it`s work well @yorkie Great! It helps me.

For anyone who hasn’t upgraded NPM recently, use npm install -g npm per @bolivar’s suggestion.

Upgrading npm solved my problem but thanks a lot guys!!!

This issue is resolve in https://github.com/taobaofed/react-web/issues/136 :

use node 5.x instead of node 6

or

add a key 'publicPath' to the webpack config output node

output:{
    publicPath:''
}

Just joining the party… and celebration for babel-core to @6.10.4 – Glad I googled this as I was about to start debugging!

Had to downgrade to node v5.12 and babel-core is at v6.25.

Annoying that I can’t even use the LTS version of Node.

I had the same issue for node v6.8.0: I solved the Problem by updating to:

    "babel-core": "6.17.0",
    "html-webpack-plugin": "2.16.0",

You might need to update update html-webpack-plugin as well.

Upgrading babel-core to 6.11.4 seems to fix this issue with node6, why this still gets opened?

Same issues here, looking forward to see it merged!