Skip to content

Cannot find module 'react-native-gesture-handler/jest-utils' on nightly builds #4082

@tobisamuel

Description

@tobisamuel

Description

On the nightly builds (3.0.0-nightly-20260410-9a6c6096e and later), Jest tests that import from react-native-gesture-handler/jest-utils fail with:

Cannot find module 'react-native-gesture-handler/jest-utils'

  at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)

The nightly builds dropped the lib/commonjs/ output — only lib/module/ and lib/typescript/ are produced. The top-level package.json was correctly updated to point to lib/module/index.js, but jest-utils/package.json was not — it still points to the now-nonexistent ../lib/commonjs/jestUtils/index:

// node_modules/react-native-gesture-handler/jest-utils/package.json
{
  "main": "../lib/commonjs/jestUtils/index",  // ← does not exist
  "module": "../lib/module/jestUtils/index",   // ← exists
  "react-native": "../src/jestUtils/index"      // ← exists
}

Jest resolves modules using the main field, so it fails.

Steps to reproduce

  1. Install a nightly build: react-native-gesture-handler@nightly
  2. Import from jest-utils: import { fireGestureHandler, getByGestureTestId } from 'react-native-gesture-handler/jest-utils'
  3. Run jest
  4. Observe the module resolution error

A link to a reproduction repo

https://github.com/tobisamuel/web-repro

Run bun test to see the error.

Gesture Handler version

3.0.0-nightly-20260410-9a6c6096e

React Native version

0.83.4

Platforms

N/A (Jest test environment)

JavaScript runtime

Hermes

Workflow

Using Expo Go

Architecture

New Architecture (Fabric)

Build type

Debug mode

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions