簡體   English   中英

類型錯誤:this._extensions.close 不是 webpack 中的函數

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

為了避免 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”。

當你在 webpack-dev-server 上運行時你會遇到這個問題。 卸載之前版本的 webpack-dev-server(也從 package.json 中刪除)並安裝最新版本的 webpack-dev-server。 那為我解決了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM