Getting an error and I don't know why. Any idea?
Unexpected token / in JSON at position 233
I have found a few possible fixes and implemented them but they have not worked either.
This is the code:
const v2_ABIs = require("./Uniswap_V2_ABIs.json");
const v2abi = JSON.parse(v2_ABIs);
v2abi = v2abi.trim();
console.log(v2abi);
I had a read through the comments. If removing JSON.parse stopped causing the error. That means the JSON you where using contained something that caused a js exception when trying to parse it. If you can share the JSON I can pinpoint the exact issue, but if you don't actually need to parse it then its no problem.