Errors During Integration with React Native
See original GitHub issueI am trying to use this package in React Native and use react-native-fs
to fufill the FS duties that isomorphic-git
requires. However, I noticed that many of the commands (lstat
, stat
, symlink
, etc) that were mentioned by the BYOFS docs page did not exist in that library. As a result, I forked the library and added those commands (on a per-branch basis, then merged all branches into an all-commands
branch)
Once I had the 1:1 mapping I knew I’d need, I decided to get started actually using the FS tools at my disposal. So, I created a demo app to test my newfound lstat
, etc commands:
And they all seem to write/read/lstat as-expected both from files in the app folder as well as external folders (which is important because Android has some weird permissions for external storage usage)
Next step was to use the isomorphic-git
module. I was initially prevented by https://github.com/isomorphic-git/isomorphic-git/issues/597, but the workaround mentioned in a comment https://github.com/isomorphic-git/isomorphic-git/issues/597#issuecomment-443271254 provided a workaround until that issue is closed. So, this is where my use.fs
command is, and here’s the file I’m using to map isomorphic-git
FS commands to react-native-fs
commands.
However, upon running commands I find myself regularly getting ENOENT (No such file or directory)
when trying to clone a repo using isomorphic-git
.
Running “logs” (adding a console.log
on every FS opperation, then trying to clone) provdes me with:
The logs when running git clone
``` Cloning to /data/user/0/com.gitgui/files/test//unist-util-flat-filter.git rnfs-to-iso-git-fs.js:45 mkdir /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/hooks rnfs-to-iso-git-fs.js:45 mkdir /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/info rnfs-to-iso-git-fs.js:45 mkdir /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/objects/info rnfs-to-iso-git-fs.js:45 mkdir /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/objects/pack rnfs-to-iso-git-fs.js:45 mkdir /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/heads rnfs-to-iso-git-fs.js:45 mkdir /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/tags rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/HEAD rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/packed-refs rnfs-to-iso-git-fs.js:53 stat /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/HEAD rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/packed-refs rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/HEAD rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/packed-refs rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/heads/master rnfs-to-iso-git-fs.js:53 stat /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/objects/7e/0bef3c6668204450c084bb40edea4bcd742f0f bundle.umd.min.js:1 Unhandled error in "FileSystem.exists()" function Error: stat failed: ENOENT (No such file or directory) at Object.fn [as stat] (NativeModules.js:99) at stat (FS.common.js:304) at Object.stat (rnfs-to-iso-git-fs.js:54) at _callee$ (bundle.umd.min.js:1) at tryCatch (runtime.js:45) at Generator.invoke [as _invoke] (runtime.js:271) at Generator.prototype.<computed> [as next] (runtime.js:97) at c (bundle.umd.min.js:1) at a (bundle.umd.min.js:1) at bundle.umd.min.js:1 rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/shallow rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/shallow rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/config rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/remotes/origin/HEAD rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/remotes/origin/master rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/objects/pack/pack-19444dcb5bcfef470369f4561308e7cc9b63a405.pack rnfs-to-iso-git-fs.js:25 writeFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/objects/pack/pack-19444dcb5bcfef470369f4561308e7cc9b63a405.idx rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/packed-refs rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/master rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/master rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/tags/master rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/refs/heads/master rnfs-to-iso-git-fs.js:21 readFile /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/packed-refs rnfs-to-iso-git-fs.js:53 stat /data/user/0/com.gitgui/files/test/unist-util-flat-filter.git/.git/master bundle.umd.min.js:1 Unhandled error in "FileSystem.exists()" function Error: stat failed: ENOENT (No such file or directory) at Object.fn [as stat] (NativeModules.js:99) at stat (FS.common.js:304) at Object.stat (rnfs-to-iso-git-fs.js:54) at _callee$ (bundle.umd.min.js:1) at tryCatch (runtime.js:45) at Generator.invoke [as _invoke] (runtime.js:271) at Generator.prototype.<computed> [as next] (runtime.js:97) at c (bundle.umd.min.js:1) at a (bundle.umd.min.js:1) at bundle.umd.min.js:1 ExceptionsManager.js:44 Error: stat failed: ENOENT (No such file or directory) ```At which point my app hits a critical error and the clone no longer continues. Is there any advice for how to advance? I feel entirely stuck on debugging this issue
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
@wmhilton I’m currently in the Gitter. Looking forward to seeing you there! 👋
Oh golly I’m super excited you were actually able to see this issue!
Ahh, the parent package.json. I can easily update that. I’d set it to try to make prototyping and debugging easier but I can change that for sure.
This weekend would work perfectly for me! I’d absolutely LOVE help with this!
I love love love the outline provided with what errors are throwing what. I think this might be useful as an outline to include in the mention of the
fs
plugin docs, but I should be able to look into that until this weekend. I super understand the limitations of using errors as a method for checking, I’ve honestly been blown away with how feature filled and stable (from my testing on Node) this project has been!All in all, I’ll see what I can figure out until this weekend and when it rolls around I’d love the assistance on it