简体   繁体   中英

TypeError: this._extensions.close is not a function in webpack

To avoid TypeError: this.htmlWebpackPlugin.getHooks is not a function. When using

    var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');

    new InterpolateHtmlPlugin(HtmlWebPackPlugin, {
      PUBLIC_URL: '/public',
    }),...

I upgraded "html-webpack-plugin" to "^4.0.0-beta.11" as recommended by https://github.com/facebook/create-react-app/issues/5465#issuecomment-438270664

And then I got this error 'TypeError: this._extensions.close is not a function'.

You will have this issue when you are running on webpack-dev-server. Uninstall the previous version of webpack-dev-server (also remove it from package.json) and install the latest version of webpack-dev-server. That solved it for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM