-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hi there. I get this error on macOS.
var data = new Object();
data.name = name;
data.address = address;
storage.set('customers.json', data)
.then(() => {
console.log('Data saved successfully!')
})
.catch((err) => {
console.log(err);
});
It writes to the file but then when I use the get function,
var oldData = storage.get('customers.json')
.then(d => {
console.log(d);
})
.catch(err => {
console.log(err);
});
It gives me that the error.
And here is what the console gives:
Error: The file in path /Users/syncster31/Library/Application Support/ASMS/customers.json is not a valid json file
at /Users/syncster31/Documents/Programming/Electron/my-app/node_modules/electron-storage/dist/index…:37
at tryToString (fs.js:449)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436)
Metadata
Metadata
Assignees
Labels
No labels