itinance / itinance/react-native-fs

Extra bracket when saving a JSON file

Open
#869 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

In my app, I save a JSON file, and somewhere I load it back.
But when I try to load it back, the parsing process fails:
The saved JSON file as an extra bracket at the end.

### 🎨 📸
Here is a screenshot

![extra-bracket](https://user-images.githubusercontent.com/13006409/77228878-85a40800-6b8a-11ea-93f4-893266864c77.jpg)

So I saved the file in [`RNFS.DownloadDirectoryPath`](https://github.com/itinance/react-native-fs/blob/a67a8d7cc7b51fc7892cf5a345c62efe22054fde/FS.common.js#L623) so I can check it myself from a File Explorer, and yeah, the file on the disk really has an extra bracket. The JSON is invalid.

### 🤔 😫

What's could be the problem? Can someone help?

Versions:
```json
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-fs": "^2.16.6",
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.