concurrent builds fail due to shared use of /tmp/metro-cache/
See original GitHub issueDo you want to request a feature or report a bug?
bug
What is the current behavior?
Concurrently-running react-native builds often fail with e.g.:
ENOENT: no such file or directory, open '/tmp/metro-cache/03/2ed8513838f8bad0238a0a6032e415d1ea766f50f498e7d284ac6a05cb0b4000001234'
Error: ENOENT: no such file or directory, open '/tmp/metro-cache/03/2ed8513838f8bad0238a0a6032e415d1ea766f50f498e7d284ac6a05cb0b400001234'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1291:33)
at FileStore.set (/Users/jenkins/src/node_modules/metro-cache/src/stores/FileStore.js:43:8)
at Cache.set (/Users/jenkins/src/node_modules/metro-cache/src/Cache.js:96:31)
at /Users/jenkins/src/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:127:13
at Generator.next (<anonymous>)
at step (/Users/jenkins/src/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:11:657)
at /Users/jenkins/src/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:11:817
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install
and yarn test
.
What is the expected behavior?
I’d expect concurrently-running builds not to interfere with each other.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
MacOS 10.13.3 node 8.9.4 npm 5.6.0 started seeing this when upgraded react-native from 0.55.4 to 0.57.2 => (from our package-lock.json) metro went from 0.30.2 to 0.47.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:17 (2 by maintainers)
Top Results From Across the Web
How to clear react-native cache? - Stack Overflow
Because I'm trying to clear cache in react-native, to be able to repeat a bug that only occurs on first usage. But clearing...
Read more >Troubleshooting common React Native bugs - LogRocket Blog
This troubleshooting guide shares how to easily find and address common React Native bugs. See common error examples.
Read more >Concurrent build in Jenkins CI fail because of cache lock file
The easiest way to fix it is to use a gradle user home dir local for each project: gradle -g . gradle [options]...
Read more >Cache - webpack
cacheUnaffected must be enabled to use it. Type: boolean; v5.54.0+. webpack.config.js module.exports = ...
Read more >Cache not always restored on concurrent > 1 and docker ...
We need to use the cache for all build/pipeline. We have the same issue on running multi-concurrent runner (v10.8.0).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reset the cache
react-native start --reset-cache
Note that resetting the cache will only work if you have write permission to the newly created files and directories. If you are on a shared machine with your own login, then you can’t build and you can’t cleanup. Could you make the directory world writable so others can delete things?