Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 With less-loader: TypeError: this.getLogger is not a function #185

Open
KyrieLii opened this issue Jun 3, 2023 · 3 comments
Open

Comments

@KyrieLii
Copy link

KyrieLii commented Jun 3, 2023

Related to this issue#10.

  • Operating System: macOS 12.5.1
  • Node Version: v16.18.0
  • NPM Version: 8.19.2
  • webpack Version: 5.76.1
  • thread-loader Version: 4.0.2

Expected Behavior

Using with less-loader can work.

Actual Behavior

Error:

TypeError: this.getLogger is not a function
    at Object.lessLoader (/xxx/thread-loader-demo/node_modules/.pnpm/less-loader@11.1.2_less@4.1.3+webpack@5.76.1/node_modules/less-loader/dist/index.js:36:23)
    at LOADER_EXECUTION (/xxx/thread-loader-demo/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
    at runSyncOrAsync (/xxx/thread-loader-demo/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
    at iterateNormalLoaders (/xxx/thread-loader-demo/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:251:2)
    at /xxx/thread-loader-demo/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:224:4
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)

Code

https://github.com/KyrieLii/thread-loader-demo/blob/main/webpack.config.js

How Do We Reproduce?

git clone git@github.com:KyrieLii/thread-loader-demo.git

npm i -g pnpm@7

pnpm install

pnpm start
@KyrieLii
Copy link
Author

KyrieLii commented Jun 3, 2023

If nobody follows up, I will attempt to help fix this issue. (when I have time 馃槀)

@benjamin-hodgson
Copy link

I fixed this some time ago in #130, never got merged tho. Feel free to pick up from the work in that PR!

@alexander-akait
Copy link
Member

@benjamin-hodgson Sorry for delay, let's finish #130, we need to remap all methods from webpack logger, i.e. webpack logger has .time()/.trace() and etc methods, so to finish it we need to support all of them, i.e. https://github.com/webpack/webpack/blob/main/lib/logging/Logger.js#L38, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants