-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Syntax Error: Unexpected token < (in lib/sendgrid.js triggered on a response object) #339
Comments
Hello @iamgollum, Thanks for taking the time to submit an issue! I have added this to our backlog for review. Meanwhile, perhaps this will help: https://github.com/sendgrid/sendgrid-nodejs/blob/master/USE_CASES.md#transactional_templates Thanks! |
Are you still having an issue? |
I'm having this issue. And I'm using a transactional template as in the link you posted. |
Hmm, I'm thinking this issue is related: #347 I'm reclassifying this one as a bug and will check them out together. |
Meanwhile, do you have a code sample we can use to help reproduce? Thanks! |
@thinkingserious I will try and provide a code sample this weekend. I am coming back to sendgrid now at work and going to revisit everything. I apologize for falling off the face of the earth |
Bah! Have been getting this exact problem for a few hours. Turns out the path is sensitive to the leading slash.
vs
The first snippet works, whereas the second will give you the json parse error :( We've been a long time sendgrid customer, but just started playing with the api and this lib. Perhaps this detail is well documented and I have overlooked it? Would be nice for the lib to automatically prefix the slash if we omit it. |
Sorry you had to deal with that :( We are working on a better helper that hides all of those details from you. You should not have to care about any of the parameters. You can follow the project here: https://github.com/sendgrid/sendgrid-nodejs/projects Thanks! |
No worries. We love the service! |
The new helper is in development here: #378 |
- Use the replyToList header to set multiple emailIds in the reply-to section of an email - Fixed old test cases that were failing as SendGrid changed the acceptable response code to 202
Issue Summary
After sending out a templated email using SendGrid's email helper utility. The server response from SendGrid's API is returning invalid JSON according to this wrapper (sendgrid-nodejs).
Line 110 is:
Steps to Reproduce
Example:
You can even create a mocha test, I ran this from this test environment:
The sendEmail function contains the normal POST V3 setup to call the APIas described in the documents.
Technical details:
The text was updated successfully, but these errors were encountered: