[Worklets] Babel plugin exception: ENOENT: no such file or directory, open '.../react-native-worklets/.worklets/13975423912094.js'
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
Clone the reproducer repository:
git clone https://github.com/hannojg/worklets-bundle-mode-reproducer.git cd worklets-bundle-mode-reproducer git checkout codex/cold-build-reproInstall dependencies:
bun installRun the cold-build repro on iOS:
cd example bun run repro:cold-build:iosObserve 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