Closed ebisbe closed 7 years ago
This error is likely a superagent error since it comes from well within the superagent client code. I did a brief search over the superagent issues and didn't see anything that sounded like this particular issue. If you keep seeing this issue, feel free to reopen this and we'll investigate.
To your original issue, flickr-sdk@3.3.0 is out now and should eliminate the need for you to call unset()
in the first place as we've removed the custom header. Please let me know if that fixed your issue or not!
@jeremyruppel The issue is with the parseFlickr() method. If I delete from _parseBody this condition it works as it should.
if(this.req._parser) { return this.req._parser(this, str); }
Inside this if it's callgin parseFlickr
@pdokas @jeremyruppel I still have this problem.
Uncaught (in promise) Error: Parser is unable to parse the response
at Request.eval (client.js?a54e:399)
at Request.Emitter.emit (index.js?ea2f:133)
at XMLHttpRequest.xhr.onreadystatechange (client.js?a54e:708)
The issue happens as I say in the previous command. I'm trying this in a new project with a fresh installation.
Wow, sorry it took so long to get around to this! You're absolutely right, our browser REST client was 100% broken. I just released v3.4.0 with a fix for that. Can you try that out and let me know if it fixes things for you?
@ebisbe, thank you for your bug report! Hit me up at eric@flickr.com so we can send you something :)
Hi Again! I still have some issues related with that. I don't think it's a regression but more an edge case.
Error: Parser is unable to parse the response at Request.eval (client.js?a54e:399) at Request.Emitter.emit (index.js?7aa5:133) at XMLHttpRequest.xhr.onreadystatechange (client.js?a54e:708)
This error pops when I do flickr.groups.pools.getPhotos to a private group from the browser directly ( no keys uses, apart from the app key). The response of the body is correct
{stat: "fail", code: 2, message: "You don't have permission to view this pool"}
But I cannot use the message due to the Parser error.
@jeremyruppel @superic
@ebisbe hm, that's definitely a weird error. I just cut a v3.5.0 release that cleans up some of the response parsing code for the REST API client. Would you mind trying that out and see if that fixes the error? If not, feel free to open up a new GH issue and we'll get to the bottom of it.
I wonder how everyone dealt with the CORS OPTIONS preflight. I'm having a browser app (built with webpack) make a call with flickr.interestingness.getList() and it always sends an OPTIONS request, which gives me this error in Chrome browser:
Failed to load https://api.flickr.com/services/rest?method=flickr.interestingness.getList&format=json&nojsoncallback=1&api_key=<API_KEY_REDACTED>: Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
@baohouse Theres an error that didn't get solved correctly but I'm using a GraphQL project over Flickr that didn't have this issues so I don't bothered any more on this. The two or three functions that I use directly on the browser works fine for me. Sorry couldn't help
@baohouse @ebisbe thanks again for sticking with this issue. The CORS hint was the crucial thing I think we were missing. I just shipped v3.7.0 that should address the preflight issue. Please let me know if things still aren't working as you'd expect.
After adding .unset('X-Flickr-API-Method') I got the following error: Error: Parser is unable to parse the response I've reviwed the code and the error occurs on line 6220 from flickr-sdk.js