[Worklets] Babel plugin exception: ENOENT: no such file or directory, open '.../react-native-worklets/.worklets/13975423912094.js'

Author: hannojgCreated Apr 5, 2026Updated Sep 18, 2026
LabelsPlatform: AndroidPlatform: iOSRepro provided

Description

In reactbundle mode, a cold first build can fail because the Babel plugin rewrites a worklet to reference a generated module under react-native-worklets/.worklets/<hash>.js, but that generated file does not exist yet during the same bundle pass. As a result, the first clean export/build fails with an ENOENT error for the missing .worklets file.

Steps to reproduce

Yes. I’d use this for the upstream issue:

Steps to reproduce

  1. Clone the reproducer repository:

    bash
    git clone https://github.com/hannojg/worklets-bundle-mode-reproducer.git
    cd worklets-bundle-mode-reproducer
    git checkout codex/cold-build-repro
  2. Install dependencies:

    bash
    bun install
  3. Run the cold-build repro on iOS:

    bash
    cd example
    bun run repro:cold-build:ios
  4. Observe the first clean bundle fail with an error similar to:

    [Worklets] Babel plugin exception: ENOENT: no such file or directory, open '.../node_modules/react-native-worklets/.worklets/<hash>.js'

Snack or a link to a repository

https://github.com/hannojg/worklets-bundle-mode-reproducer/tree/codex/cold-build-repro

Reanimated version

4.1.1

Worklets version

0.8.1

React Native version

0.81.5

Platforms

Android, iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Reanimated feature flags

None

React Native release level

None

Build type

No response

Device

No response

Host machine

None

Device model

No response

Acknowledgements

Yes

Source: software-mansion/react-native-reanimated