Skip to content

[Feature]: Better error message if using old jsdom #16168

Closed

Description

@jmuransky

🚀 Feature Proposal

If user updated minor version of jest to 30.4 (I know this happens if previous version was 30.2) and forgets to update jest-environment-jsdom to version 30, then he gets a bit cryptic error message:

Test suite failed to run
TypeError: this._moduleMocker.clearMocksOnScope is not a function
at Runtime.resetModules (../jest/packages/jest-runtime/build/index.js:3781:28)

It would be nice if user instead got error message, that would help him fix the issue (in a sense of "update your jsdom").

Motivation

Without proper error message, people might get lost and spend a lot of time trying to figure out what went wrong.

Example

Running the test with old version should produce an error of "update your jest-environment-jsdom to latest version"

Pitch

Because it's about interoperability between jest and it's component

Activity

  1. jmuransky commented on May 12, 2026

    @jmuransky
    ContributorAuthor

    I fully intend to write my pull request for this very soon.

  2. added a commit that references this issue on May 22, 2026
  3. eroo36 commented on Jun 2, 2026

    @eroo36

    Just had this issue today and I was only able to fix it because I found this issue and for me it was for jest-environment-node instead of jest-environment-jsdom

  4. marwin1991 commented on Jun 16, 2026

    @marwin1991

    +1

  5. github-actions commented on Jul 17, 2026

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
    Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

  6. locked as resolved and limited conversation to collaborators on Jul 17, 2026
  7. SimenB commented on Aug 28, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions