Closed Vanilagy closed 5 years ago
which version are you using?
I'm using node-persist@3.0.1
looks like datum
is undefined, which is weird, but I don't think I can debug this without looking at your directory, if it's not sensitive information, can you compress your directory and share it with me? privately if you prefer, to bentael@gmail.com
Uh, I'm sorry, but it is quite sensitive information. Or rather, it's my school's information that they'd like to keep private. My fix was to just add "return datum && datum.ttl..." so it wouldn't throw. Regarding what caused this, I'm sorry but I couldn't find the reason. This bug just appeared to me suddenly one day.
Maybe it has to do with the file not loading correctly? My storage options are {forgiveParseErrors: true, ttl: false}.
oh ok no problem, i pushed a possible fix, i think you might have another process/application accessing the same directory and leaving unparseable files in there, like Google Drive or something else, then when you forgiveParseErrors
these datum
resolved here is undefined
Anyways, pushed fix to 3.0.3
- but anyways, if you set forgiveParseErrors: false
then rerun your app, you should be able to catch the culprit file.
[2019-01-02T13:45:59.111Z] (node:7636) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'ttl' of undefined at isExpired (C:...\node_modules\node-persist\src\local-storage.js:43:15) at Array.filter ()
at LocalStorage.keys (C:...\node_modules\node-persist\src\local-storage.js:111:16)
at
[2019-01-02T13:45:59.114Z] (node:7636) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[2019-01-02T13:45:59.115Z] (node:7636) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I just got this error today. NO clue where it's coming from.