Skip to content

babel-loader@9.2.0 resulted in a runtime error, this.getLogger is not a function when using with thread-loader #1043

@ijlee2

Description

@ijlee2

BEFORE YOU SUBMIT please read the following:

Delete what isn't applicable below
I'm submitting a bug report

Please tell us about your environment:
Webpack Version: 5.94.0
Babel Core Version: 7.25.2
Babel Loader Version: 9.2.0

Current behavior:

The start and test commands for a fresh Ember app failed with a runtime error:

Module build failed (from ../../../../node_modules/.pnpm/thread-loader@3.0.4_webpack@5.94.0/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
this.getLogger is not a function
    at PoolWorker.fromErrorObj (/node_modules/.pnpm/thread-loader@3.0.4_webpack@5.94.0/node_modules/thread-loader/dist/WorkerPool.js:346:12)
    at /node_modules/.pnpm/thread-loader@3.0.4_webpack@5.94.0/node_modules/thread-loader/dist/WorkerPool.js:219:29
    at mapSeries (/node_modules/.pnpm/neo-async@2.6.2/node_modules/neo-async/async.js:3625:14)
    at Object.loader (/node_modules/.pnpm/babel-loader@9.2.0_@babel+core@7.25.2_webpack@5.94.0/node_modules/babel-loader/lib/index.js:44:23)
    at Object.<anonymous> (/node_modules/.pnpm/babel-loader@9.2.0_@babel+core@7.25.2_webpack@5.94.0/node_modules/babel-loader/lib/index.js:39:12)

The Ember app indirectly uses @embroider/babel-loader-9, which depends on babel-loader>=9.0.0.

Expected/desired behavior:

The start and test commands run without an error.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.
# Create a monorepo with `docs-app` (the Ember app in question)
npx create-v2-addon-repo@0.10.4 my-repo
cd my-repo
pnpm install

# Run `docs-app`
cd docs-app
pnpm start

# Test `docs-app`
pnpm test
  1. Verify that start and test commands run without error.
  2. Remove pnpm.overrides in the workspace root package.json, then run pnpm install to allow babel-loader@9.2.0 to be installed. Run the start and test commands again to see the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions