Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

webpack

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?

like image 308
Murakami Avatar asked Nov 07 '18 13:11

Murakami


1 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)
like image 128
Dawid Laszuk Avatar answered Nov 06 '22 10:11

Dawid Laszuk