【问题标题】:TypeError: this._extensions.close is not a function in webpackTypeError: this._extensions.close 不是 webpack 中的函数
【发布时间】:2020-06-12 18:52:22
【问题描述】:

为了避免 TypeError:this.htmlWebpackPlugin.getHooks 不是函数。使用时

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

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

我按照https://github.com/facebook/create-react-app/issues/5465#issuecomment-438270664的建议将“html-webpack-plugin”升级为“^4.0.0-beta.11”

然后我得到了这个错误'TypeError: this._extensions.close is not a function'。

【问题讨论】:

    标签: javascript html reactjs webpack webpack-dev-server


    【解决方案1】:

    当你在 webpack-dev-server 上运行时,你会遇到这个问题。卸载之前版本的 webpack-dev-server(也将其从 package.json 中删除)并安装最新版本的 webpack-dev-server。这为我解决了。

    【讨论】:

      猜你喜欢
      • 2020-07-06
      • 1970-01-01
      • 2018-03-28
      • 1970-01-01
      • 2021-05-27
      • 1970-01-01
      • 1970-01-01
      • 2019-09-19
      • 2013-12-12
      相关资源
      最近更新 更多