11

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?

2
  • same problem here Commented Dec 5, 2016 at 14:22
  • Same problem here as well... any updates? Commented Mar 31, 2017 at 13:45

4 Answers 4

7

When I am learning Writing your AngularJS with Redux

I got the the error "ERROR in The "path" argument must be of type string. Received type undefined webpack: Failed to compile.enter image description here"

At last I figured out the issue by add filename (filename: 'index.html',) to webpack.config.js accoring to CrzMarvin solution. enter image description here

ThX CrzMarvin

Sign up to request clarification or add additional context in comments.

Comments

1

I had the same problem before,then I think it's something wrong with the plugin. then, I add filename to this plugin.It worked.

// webpack.config.js

plugins: [
    new HtmlWebpackPlugin({
        title: 'use plugin',
        filename: 'index.html'
    })
]

Comments

0

You should install html-webpack-plugin dependency instead of webpack-html-plugin. I had the same issues before

Comments

0

The following solution is fine and Working for node v14.2.0

new HtmlWebpackPlugin({
  title: 'use plugin',
  filename: 'index.html',
  template: path.join(client.srcPath, client.entryHtml)
})

2 Comments

Please format your code properly, click here to learn how.
While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.