Problem
When building a production bundle, jest-worker unconditionally sets JEST_WORKER_ID on every worker process it spawns, even EAS builds when no tests are involved.
react-native-dotenv's Babel plugin runs inside those Metro transform workers and inlines variables from process.env into the bundle — including JEST_WORKER_ID, which is not declared in any .env file but is present in the worker's environment because jest-worker set it.
Impact
The result is a production app bundle with JEST_WORKER_ID as a non-null string. JEST_WORKER_ID now appears in third-party library code, in my case react-native-mmkv, which causes problems with that package (permanently sets it in test mode).
Issues with this have been raised in react-native-mmkv but I believe this problem belongs to react-native-dotenv.
Problem
When building a production bundle,
jest-workerunconditionally setsJEST_WORKER_IDon every worker process it spawns, even EAS builds when no tests are involved.react-native-dotenv's Babel plugin runs inside those Metro transform workers and inlines variables from process.env into the bundle — includingJEST_WORKER_ID, which is not declared in any .env file but is present in the worker's environment because jest-worker set it.Impact
The result is a production app bundle with
JEST_WORKER_IDas a non-null string.JEST_WORKER_IDnow appears in third-party library code, in my casereact-native-mmkv, which causes problems with that package (permanently sets it intestmode).Issues with this have been raised in
react-native-mmkvbut I believe this problem belongs toreact-native-dotenv.