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
- Install a nightly build:
react-native-gesture-handler@nightly
- Import from jest-utils:
import { fireGestureHandler, getByGestureTestId } from 'react-native-gesture-handler/jest-utils'
- Run
jest
- 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
Description
On the nightly builds (
3.0.0-nightly-20260410-9a6c6096eand later), Jest tests that import fromreact-native-gesture-handler/jest-utilsfail with:The nightly builds dropped the
lib/commonjs/output — onlylib/module/andlib/typescript/are produced. The top-levelpackage.jsonwas correctly updated to point tolib/module/index.js, butjest-utils/package.jsonwas not — it still points to the now-nonexistent../lib/commonjs/jestUtils/index:Jest resolves modules using the
mainfield, so it fails.Steps to reproduce
react-native-gesture-handler@nightlyimport { fireGestureHandler, getByGestureTestId } from 'react-native-gesture-handler/jest-utils'jestA link to a reproduction repo
https://github.com/tobisamuel/web-repro
Run
bun testto 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