Webpack 4, this.htmlWebpackPlugin.getHooks is not a function

Viewed 6996

I'm migrating from webpack 3 to 4 and it is painfull ;)

I'm getting this error:

this.htmlWebpackPlugin.getHooks is not a function

I was trying to upgrade all plugins but maybe I'm missing something here?

2 Answers

There was an update to the thread that Bruce linked. As explained by adambreznicky to fix the issue one should:

  1. delete old node_modules and reinstall fresh
  2. npm i --save-dev html-webpack-plugin@next
  3. modify new InterpolateHtmlPlugin(env.raw) to new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw)
Related