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

fix: getLogger not defined in child loader

Open benjamin-hodgson opened this issue 3 years ago • 2 comments

This PR fixes #10 and #185.

This PR contains a:

  • [x] bugfix
  • [ ] new feature
  • [ ] code refactor
  • [x] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

Currently thread-loader is not compatible with less-loader, as outlined in #10 which was closed without resolution.

less-loader calls this.getLogger, which worker.js hadn't defined when calling loaderRunner.runLoaders, so it crashed. I set up getLogger to simply write to the child process's console, instead of messaging back to the parent process - the PoolWorker doesn't currently have access to the parent loader's getLogger function and it seemed like too big of a change to pass it in. I'm open to changing this (but would prefer to get this fix released as soon as possible since it's a live issue.)

Thanks!

Breaking Changes

None

Additional Info

benjamin-hodgson avatar Dec 08 '21 16:12 benjamin-hodgson

Hello, just following up on this bugfix. This is a live issue affecting any build configurations using thread-loader with less-loader. Thanks!

benjamin-hodgson avatar Dec 15 '21 21:12 benjamin-hodgson

@alexander-akait Would really appreciate a resolution to this. It's blocking my team from upgrading less-loader.

abalbanyan avatar Aug 12 '22 17:08 abalbanyan