I'm trying to import a large JSON file but I'm getting this error:
Unexpected token , in JSON at position 197031914
how do i go to that position to fix it?
Thanks!
Just use a JSON linter. There are plenty online, like this one. The linter will point out the specific errors in the syntax of your JSON file.
Besides the recommendations of using a json linter, this extension lets you navigate to a specific offset (position) within a file. You'd want to go to offset 197031914
.
Keep in mind that if the file has very long lines, VS Code will not display the entire line. You can try adjusting this limit by following these steps
I know this is an older question but since its getting some views I want to mention how I ended up solving this issue.
Because I was processing huge files (gigabytes), it was not working with linters, so I ended up solving this issue by writing my script that takes a readable stream and find that position and then return the context (x number of charachters before and after position).
I still use it and I might get around to publish it on npm for others to use. (not sure if someone had already done a similar thing);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With