用mini-css-extract-plugin、postcss-loader、less打包失败

小丑先生
  • 8
  • webpack 5.37.1
  • mini-css-extract-plugin 1.6.0
  • postcss-loader 5.3.0
  • less 4.1.1
ERROR in ./src/views/app.vue?vue&type=style&index=0&lang=less& (./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-7[0].rules[0].use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-7[0].rules[0].use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-7[0].rules[0].use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/app.vue?vue&type=style&index=0&lang=less&)
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: node.getIterator is not a function
    at LazyResult.visitTick (E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\postcss\lib\lazy-result.js:522:33)
    at LazyResult.runAsync (E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\postcss\lib\lazy-result.js:402:30)
    at async Object.loader (E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\postcss-loader\dist\index.js:87:14)
    at processResult (E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\webpack\lib\NormalModule.js:700:19)
    at E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\webpack\lib\NormalModule.js:806:5
    at E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\loader-runner\lib\LoaderRunner.js:399:11
    at E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\loader-runner\lib\LoaderRunner.js:251:18
    at context.callback (E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
    at Object.loader (E:\looveepay\01.CI\1.7 Code\Web\1.7.3 Trunk\looveepay_merchant\node_modules\postcss-loader\dist\index.js:96:7)
 @ ./src/views/app.vue?vue&type=style&index=0&lang=less& 1:0-482 1:0-482
 @ ./src/views/app.vue 4:0-64
 @ ./src/main.js 7:0-32 28:13-20

只要我不加postcss-loader,就可以打包成功。所以应该是postcss-loader的问题?还是mini-css-extract-plugin的问题?

回复
阅读 226
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
你知道吗?

宣传栏