Closed bissolli closed 7 years ago
Hello @gustavobissolli,
Ah yes, fs in not allowed in the browser. We need to figure out a way to not include that dependency when used on the client side. I've added this to our backlog for further investigation.
Thanks!
Elmer
Understand @thinkingserious!
Do you know an alternative way to send emails by the client side?
@gustavobissolli,
Can you try deleting this folder? https://github.com/sendgrid/sendgrid-nodejs/tree/master/lib/helpers/inbound
Unfortunately still not working =/
This relative module was not found:
* ./lib/helpers/inbound/parse.js in ./~/sendgrid/index.js
I guess for while I should send an Ajax request to my server service to do it through my php api...
You can try deleting this line also: https://github.com/sendgrid/sendgrid-nodejs/blob/master/index.js#L4
If you choose the PHP route, you can use: https://github.com/sendgrid/sendgrid-php
@thinkingserious great! Looks we get a step forward now =)
I have the following error about my request:
Fetch API cannot load https://api.sendgrid.com/v3/mail/send. Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://sendgrid.api-docs.io' that is not equal to the supplied origin. Origin 'http://localhost:8181' is therefore not allowed access. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Could be that something related to the inbound parser or FS package missing?
It seems that this is your issue now: https://sendgrid.com/docs/Classroom/Basics/API/cors.html
Hmmm it make sense! I can't protect my API Key on a browser based application and SendGrid refuse my api call based on it!
I am going to make an end point on my API to do that job!
Thanks for the help @thinkingserious
Awesome! Please let me know if you run into any issues with developing the endpoint.
If I am not mistaken, this still appears to be an issue: #955 Or at least something like it 😄
For anyone coming here, this workaround from @nephlin7 worked for me:
// In webpack config
node: {
net: 'empty',
fs: 'empty',
tls: 'empty'
}
Hey guys!
I have a application built on webpack and VueJS2! I am trying to use this library to send email through sendgrid and I have the following problem:
I've already run
npm install --save fs
and it's still same problem!It's a client application... could be that the problem?