-
Notifications
You must be signed in to change notification settings - Fork 300
Unexpected token < in JSON at position 0 #905
Comments
Is your server configured to use https? You're trying to connect via http. |
Thanks for your response @alanshaw :) `
` `
` |
I tried opening that CID on the IPFS Gateways http://ipfs.io/ipfs/QmNXGopftrhhDcx9zJxBcdWdYm3bGSXQwT9quwB1sDmxX6 to diagnose and it never loads. Can you make a reproducible case for us to test this out? |
ping @Juanchobanano |
Hey guys! Sorry for the late response. `
}) |
ipfs.add(dataToLoad, [{"wrapWithDirectory": true}], (err, data) => { Your options are wrapped in an array, this will probably result in the directory wrapper not being applied... https://ipfs.io/api/v0/ls?arg=QmNXGopftrhhDcx9zJxBcdWdYm3bGSXQwT9quwB1sDmxX6 is working for me right now. However your server is returning the response: <html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html> https://ipfs.infura.io:5001/api/v0/ls?arg=QmNXGopftrhhDcx9zJxBcdWdYm3bGSXQwT9quwB1sDmxX6 Hope that helps. P.S. I've opened this issue to track getting better error messages for unexpected responses. |
ipfs.get throwing Unexpected token < in JSON at position 0 error This is my code ipfs.get(validCID, async function (err, files) { I kept this functionality in a loop. Even though i am passsing validCID it is throwing this error. |
Hey IPFS team, I have a strange error when trying to add new files to IPFS.
Here's my code:
`
`
It always returns the error "SyntaxError: Unexpected token < in JSON at position 0".
The value of testFile variable is " <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff fe 00 3b 43 52 45 41 54 4f 52 3a 20 67 64 2d 6a 70 65 67 20 76 31 2e 30 20 28 75 73 69 ... > "
I hope you can help me :(
The text was updated successfully, but these errors were encountered: