Skip to content

[Bug?]: ESLint "Oops! Something went wrong! :(" with Node 24.15.0 when using PnP #7106

Open

Description

@ChatDeBlofeld

Self-service

  • I'd be willing to implement a fix

Describe the bug

With Node 24.15.0 and PnP enabled, ESLint breaks with the following error:

Oops! Something went wrong! :(

ESLint: 10.2.0

TypeError: Cannot convert undefined or null to object
    at loadConfigFile (file:///assets/.yarn/__virtual__/eslint-virtual-e510b1d44f/2/root/.yarn/berry/cache/eslint-npm-10.2.0-e708d083bd-10c0.zip/node_modules/eslint/lib/config/config-loader.js:233:24)
    at async ConfigLoader.calculateConfigArray (file:///assets/.yarn/__virtual__/eslint-virtual-e510b1d44f/2/root/.yarn/berry/cache/eslint-npm-10.2.0-e708d083bd-10c0.zip/node_modules/eslint/lib/config/config-loader.js:588:23)
    at async #calculateConfigArray (file:///assets/.yarn/__virtual__/eslint-virtual-e510b1d44f/2/root/.yarn/berry/cache/eslint-npm-10.2.0-e708d083bd-10c0.zip/node_modules/eslint/lib/config/config-loader.js:369:19)
    at async entryFilter (file:///assets/.yarn/__virtual__/eslint-virtual-e510b1d44f/2/root/.yarn/berry/cache/eslint-npm-10.2.0-e708d083bd-10c0.zip/node_modules/eslint/lib/eslint/eslint-helpers.js:324:5)
    at async NodeHfs.<anonymous> (file:///root/.yarn/berry/cache/@humanfs-core-npm-0.19.1-e2e7aaeb6e-10c0.zip/node_modules/@humanfs/core/src/hfs.js:574:24)
    at async NodeHfs.walk (file:///root/.yarn/berry/cache/@humanfs-core-npm-0.19.1-e2e7aaeb6e-10c0.zip/node_modules/@humanfs/core/src/hfs.js:614:3)
    at async globSearch (file:///assets/.yarn/__virtual__/eslint-virtual-e510b1d44f/2/root/.yarn/berry/cache/eslint-npm-10.2.0-e708d083bd-10c0.zip/node_modules/eslint/lib/eslint/eslint-helpers.js:366:20)
    at async Promise.allSettled (index 0)
    at async globMultiSearch (file:///assets/.yarn/__virtual__/eslint-virtual-e510b1d44f/2/root/.yarn/berry/cache/eslint-npm-10.2.0-e708d083bd-10c0.zip/node_modules/eslint/lib/eslint/eslint-helpers.js:457:18)
    at async Promise.all (index 0)

Works fine with nodeLinker: node-modules.
Works fine with Node 24.13.1.
Affects version 9.39.* of ESLint as well.

Can't test Node 25 due to this error: #7065

Should this be posted on Node or/and ESLint trackers as well?

To reproduce

  1. Install Node >= 24.15.0
  2. Create files package.json, empty .yarnrc.yml and empty eslint.config.mjs.
{
  "name": "eslint-yarn-pnp-bug",
  "version": "1.0.0",
  "packageManager": "[email protected]",
  "devDependencies": {
    "eslint": "10.2.0"
  }
}
  1. Run yarn install && yarn eslint

Environment

System:
  OS: Linux 6.19 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Binaries:
  Node: 24.15.0 - /tmp/xfs-148a7c7b/node
  Yarn: 4.14.1 - /tmp/xfs-148a7c7b/yarn
  npm: 11.12.1 - /usr/local/bin/npm

Additional context

Minimal reproducible example has been run in a container, but the bug can be reproduced on other setups as well.

Activity

  1. MikeMcC399 commented on Apr 18, 2026

    @MikeMcC399
    Contributor
  2. MikeMcC399 commented on Apr 18, 2026

    @MikeMcC399
    Contributor
  3. clemyan commented on Apr 20, 2026

    @clemyan
    Member
  4. smeng9 commented on Apr 28, 2026

    @smeng9
    Contributor

    Hi @ChatDeBlofeld Temporary workaround for eslint:

    Perform yarn patch eslint, Remove the line in eslint/lib/config/config-loader.js with following content delete require.cache[filePath]; then perform yarn patch-commit -s /private/var/folders/pv/dl4zfc_n3g72hzphrtzm50zm0000gn/T/xfs-f085919f/user.

    Your issue should be solved.

  5. MikeMcC399 commented on May 18, 2026

    @MikeMcC399
    Contributor

    [email protected] (released May 1, 2026) avoids this error, see eslint/eslint#20813

  6. MikeMcC399 commented on May 18, 2026

    @MikeMcC399
  7. ChatDeBlofeld commented on May 19, 2026

    @ChatDeBlofeld
    Author

    I've corrected the content, thanks.

  8. web2ls commented on Jul 23, 2026

    @web2ls

    For anyone landing here from a non-ESLint context: this isn't ESLint-specific — same delete require.cache[file] / require.extensions pattern, same crash, also hits:

    • import-fresh (via cosmiconfig → postcss-loader) — require.cache[filePath] is undefined.
    • tailwindcss itself (lib/lib/setupTrackingContext.js, its own config-file cache invalidation).
    • rechoir (via webpack-cli loading webpack.config.js) — Object.keys(require.extensions) throws because require.extensions is undefined.

    Is Yarn planning its own fix/workaround on the PnP side for users stuck on 22.x or is waiting for an eventual Node-side fix the only path forward?

  9. MikeMcC399 commented on Oct 22, 2026

    @MikeMcC399
    Contributor

    This issue is causing a failure in citgm running under Node.js 22 - see nodejs/citgm#1164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions