thread-loader icon indicating copy to clipboard operation
thread-loader copied to clipboard

UnhandledPromiseRejectionWarning: TypeError: loaderContext.getLogger is not a function

Open yxw007 opened this issue 3 years ago • 1 comments

  • Operating System: win10
  • Node Version: v14.14.0
  • NPM Version: 6.14.8
  • webpack Version: 5.68.0
  • thread-loader Version: 3.0.4

Expected Behavior

Normal use thread-loader

Actual Behavior

image

Code

webpack.config.js

How Do We Reproduce?

Mini Produce Environment

I found a clue

Worker.loaders context is missing some fields and Funtion

The red box shows the missing content, context lack getLoger Function, Therefore, sass failed to obtain the getLog error

sass-loader/dist/utils.js

yxw007 avatar Feb 17 '22 07:02 yxw007

see https://github.com/webpack-contrib/sass-loader/issues/1016

AprilArcus avatar Mar 14 '22 05:03 AprilArcus

@yxw007 解决了吗,我遇到同样的问题了

JX-Zhuang avatar Aug 29 '22 13:08 JX-Zhuang

@yxw007 解决了吗,我遇到同样的问题了

版本问题,找一个以前可用的版本吧

yxw007 avatar Aug 30 '22 06:08 yxw007

@yxw007 解决了吗,我遇到同样的问题了

版本问题,找一个以前可用的版本吧

你用的哪个版本可以解决

JX-Zhuang avatar Aug 30 '22 14:08 JX-Zhuang

记得好像是webpack5.x把API都改了导致不能用,但是我直接没有这个插件了,好像要退回至webpack4.x的版本来使用这个插件,那样的话没多大必要了。如果项目不复杂可考虑之前迁移至vite打包,开发幸福指数立马提升。这个插件用的人也不多了,也不维护了建议直接放弃转用vite打包构建吧

yxw007 avatar Sep 02 '22 06:09 yxw007