DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead, как исправить?

(node:23725) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
TypeError: dep.getResourceIdentifier is not a function
    at addDependency (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:665:30)
    at iterationOfArrayCallback (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:186:3)
    at addDependenciesBlock (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:687:5)
    at Compilation.processModuleDependencies (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:698:4)
    at afterBuild (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:830:15)
    at buildModule.err (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:874:11)
    at callback (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:611:5)
    at module.build.error (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/Compilation.js:651:12)
    at handleParseResult (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/NormalModule.js:441:12)
    at doBuild.err (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/NormalModule.js:463:6)
    at runLoaders (/var/php/www/TC.develop/template/test5/node_modules/webpack/lib/NormalModule.js:327:12)
    at /var/php/www/TC.develop/template/test5/node_modules/loader-runner/lib/LoaderRunner.js:370:3
    at iterateNormalLoaders (/var/php/www/TC.develop/template/test5/node_modules/loader-runner/lib/LoaderRunner.js:211:10)
    at Array.<anonymous> (/var/php/www/TC.develop/template/test5/node_modules/loader-runner/lib/LoaderRunner.js:202:4)
    at Storage.finished (/var/php/www/TC.develop/template/test5/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at provider (/var/php/www/TC.develop/template/test5/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9)
    at /var/php/www/TC.develop/template/test5/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:525:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

package.json
{
  "name": "test5",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "webpack-cli": "^3.1.0"
  },
  "private": true,
  "scripts": {
    "dev-server": "encore dev-server",
    "dev": "encore dev",
    "watch": "encore dev --watch",
    "build": "encore production"
  },
  "dependencies": {
    "@symfony/webpack-encore": "^0.20.1",
    "axios": "^0.18.0",
    "babel-loader": "^7.1.5",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "cross-env": "^5.2.0",
    "css-loader": "^1.0.0",
    "encore": "^0.0.30-beta",
    "node-sass": "^4.9.2",
    "sass-loader": "^7.0.3",
    "vue": "^2.5.16",
    "vue-loader": "^15.2.6",
    "vue-material": "^1.0.0-beta-10.2",
    "vue-server-renderer": "^2.5.16",
    "vue-template-compiler": "^2.5.16",
    "vuex": "^3.0.1",
    "webpack": "^4.16.3"
  }
}

webpack.config.js

var Encore = require('@symfony/webpack-encore');
Encore
    // the project directory where compiled assets will be stored
    .setOutputPath('public/build/')
    // the public path used by the web server to access the previous directory
    .setPublicPath('/build')
    .cleanupOutputBeforeBuild()
    .enableSourceMaps(!Encore.isProduction())

    // create hashed filenames (e.g. app.abc123.css)
    .enableVersioning(Encore.isProduction())

    .enableVueLoader()
    .enableSassLoader()
    .addEntry('js/client', './assets/js/client.js')
    .addEntry('js/server', './assets/js/server.js')

    .configureBabel(function(babelConfig) {
        babelConfig.plugins = ["transform-object-rest-spread"]//, "vue-material"]
    })
;

module.exports = Encore.getWebpackConfig();
  • Вопрос задан
  • 3170 просмотров
Решения вопроса 1
borisdenis
@borisdenis
Ленив и вреден...
Обычное предупреждение, рекоммендуют использовать новое апи, использование Tapable.plugin нежелательно и скоро будет удалено.

А в ошибке тоже ясно написано что dep.getResourceIdentifier не является функцией, возможно где то опечатка.
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
chuanyurug
@chuanyurug
Системная аналитика, веб-дизайн
На сегодняшний день нужно другое решение.
https://github.com/webpack/webpack/issues/6568
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы