You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
handleJson: 033ec1fb-e5db-4649-b0fe-546cb4a8a74e.json
, 0.54491000000000001], [0.216, 0.55078000000000005]], [[0.23200000 0.54503000
^
SyntaxError: Unexpected number
at Object.parse (native)
at /home/jason/p4/server/node/watcher/watcher.js:149:20
at fs.js:336:14
at FSReqWrap.oncomplete (fs.js:99:15)
I am having an issue where when I read in a JSON file, it fails to parse. Note that "[[0.23200000 0.54503000" is not valid JSON, it is missing a comma. When I grep the file for that content, it is not found. Calling my handleJson function again on the same file will work. The file size is 282kB.
The handleJson function is called from a fs.watch event, However when the file is created, it is first written out to another directory, closed, then moved to this directory. Both locations are on the same filesystem so the move is atomic. Therefore, it's not a partial file issue. (Even so, node missing a comma in all that should never happen. It should not skip a byte and keep reading.) The json is being written by a well-tested JSON serializer.
The snippet above is the relevant code. Remarkably simple. I will work on something that can produce it. But it only happens about out of 100 invocations. Might be related to SSD or kernel version or something.... I'll update here wheb i have more.
I am having an issue where when I read in a JSON file, it fails to parse. Note that "[[0.23200000 0.54503000" is not valid JSON, it is missing a comma. When I grep the file for that content, it is not found. Calling my handleJson function again on the same file will work. The file size is 282kB.
The handleJson function is called from a fs.watch event, However when the file is created, it is first written out to another directory, closed, then moved to this directory. Both locations are on the same filesystem so the move is atomic. Therefore, it's not a partial file issue. (Even so, node missing a comma in all that should never happen. It should not skip a byte and keep reading.) The json is being written by a well-tested JSON serializer.
This is node v12.0
The text was updated successfully, but these errors were encountered: