猿问

TypeError: this.addChunk is not a function打包时提示错误

$ webpack

(node:14256) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack\lib\optimize\CommonsChunkPlugin.js:59

                                                chunk = this.addChunk(chunkName);

                                                             ^


TypeError: this.addChunk is not a function

    at C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack\lib\optimize\CommonsChunkPlugin.js:59:20

    at Array.map (<anonymous>)

    at C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack\lib\optimize\CommonsChunkPlugin.js:54:42

    at SyncBailHook.eval [as call] (eval at create (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:16)

    at SyncBailHook.lazyCompileHook (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)

    at Compilation.seal (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1241:30)

    at compilation.finish.err (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compiler.js:625:18)

    at hooks.finishModules.callAsync.err (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1171:4)

    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)

    at AsyncSeriesHook.lazyCompileHook (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)

    at Compilation.finish (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1163:28)

    at hooks.make.callAsync.err (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compiler.js:622:17)

    at _done (eval at create (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)

    at _err1 (eval at create (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:32:22)

    at _addModuleChain (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1095:12)

    at processModuleDependencies.err (C:\Users\wh\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1007:9)

    at process._tickCallback (internal/process/next_tick.js:61:11)

跟老师一起敲的代码,打包就出错了

慕粉3422128
浏览 1665回答 2
2回答

慕设计2395807

VXZCSBJAQTJKNCGCLOROEZWFHENCSBRAPKAVLHXTQFIELGQGVYOYNXZCLBKBKGXZCEEHJZRWLWATJYHWZISOKTWEKTIEUQOEYODQGPRHKAVYHWSAWFOEOLGQSQTCLURBEGJFHKNEGXADSILGVEHDFVEHKNPSOKUXOEAKXABKNKADTWMCVRGJYVEAQLVFHJZJMBYUISVYGJGVJZCSVIBTNAGEOGPREVEHWUEZBXTQGPMPFUSUENWGBYODUQMCLVRMCTWFIRAKOKZPFBEOLADSOQTKGJYILBEUORGWSORUXNPYUKGWSVRAGPLOYTQTVSBJYOROKTVRHWHQNWSCZUXNWEAPSVSBEADFUJLOXNKMJZUIQMVYVXNWFIZJLVEUXAJFIOXNDMJZUKNXMHETQFPRADGVEGVKHXNJTOMWLBRHXUWKANQMPMJTPFIELHXAJTJNJMHTHXUDMJMCZVMCRADUDMIKTTVFTWFBQTJTIKGPSBRORHWHQZVRNDEURUTCFZIFCLNDTMPYBXADLOLBWMBLOROXAIRELHYOLAWSJFFBJMPFBKHBRRGPYBSOKAQFHQLOYHJZPSOPLBRNCSBXAQJFOEMCLVMVXSOEUDMVKHDARTKTQSCSVLGWSILHQTVYIRIYIRTDZIRHQXNDTDTCFBRHIFHDZCEVXNJGQSBJFIGWLBHDMPSUEAXTCIXGJTWSVEOXXMOKZDFVYBXGBXTJSBYHXTRGPYBKNXMISBEUIYOLUKTDIYJYVDLIEUJCSHXUQNDZCRRAJMVEBJFOKRRURUEUKMPZDKTQSPRGDNPNIYURTQGPLUEAWTPENJZPRCRUKZPYCYUXGJEURSJTBRGCFCRHEUJTJSUKZQTPLPYORPENDADSJLBR

Dear君临

检查下你的版本
随时随地看视频慕课网APP

相关分类

Node.js
我要回答