开发者社区> 问答> 正文

webpack打包问题 extract-text-webpack-plugin报错?报错

D:\ideaproject\cqcomponent\node_modules\extract-text-webpack-plugin\dist\index.js:188
            chunk.sortModules();
                  ^

TypeError: chunk.sortModules is not a function
    at D:\ideaproject\cqcomponent\node_modules\extract-text-webpack-plugin\dist\
index.js:188:19
    at D:\ideaproject\cqcomponent\node_modules\async\dist\async.js:3083:16
    at eachOfArrayLike (D:\ideaproject\cqcomponent\node_modules\async\dist\async
.js:1003:9)
    at eachOf (D:\ideaproject\cqcomponent\node_modules\async\dist\async.js:1051:
5)
    at Object.eachLimit (D:\ideaproject\cqcomponent\node_modules\async\dist\asyn
c.js:3145:5)
    at Compilation.<anonymous> (D:\ideaproject\cqcomponent\node_modules\extract-
text-webpack-plugin\dist\index.js:184:27)
    at Compilation.applyPluginsAsyncSeries (D:\ideaproject\cqcomponent\node_modu
les\tapable\lib\Tapable.js:142:13)
    at Compilation.seal (D:\ideaproject\cqcomponent\node_modules\webpack\lib\Com
pilation.js:579:8)
    at D:\ideaproject\cqcomponent\node_modules\webpack\lib\Compiler.js:493:16
    at D:\ideaproject\cqcomponent\node_modules\tapable\lib\Tapable.js:225:11
    at _addModuleChain (D:\ideaproject\cqcomponent\node_modules\webpack\lib\Comp
ilation.js:481:11)
    at processModuleDependencies.err (D:\ideaproject\cqcomponent\node_modules\we
bpack\lib\Compilation.js:452:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

打包时出现上面的错误,应该是什么原因

展开
收起
爱吃鱼的程序员 2020-06-08 12:32:09 783 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    extract-text-webpack-plugin

    这个模块的版本和webpack不对应,装2.1.2的问题就解决了

    2020-06-08 12:32:26
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
基于webpack和npm的前端组件化实践 立即下载
SPARKLER,A web-crawler on Apache Spark 立即下载
Rebuilding Web Tracking Infras 立即下载