Fresh install trying to use @sendgrid/mail - getting this error.
Same Here 馃槙

I am experiencing the same error. Has anyone found a solution or a workaround in the short term?

_Note:_ Module not found: Error: Can't resolve 'fs' in '<my-path>/node_modules/@sendgrid/helpers/classes'
Seems like Issue #955 is related.
I found this Lil workaround, set in webpack config:
node: {
net: 'empty',
fs: 'empty',
tls: 'empty'
}
@nephlin7 thanks for the workaround!
what should be done if my project does not have a webpack config? can this go in the tsconfig?
Anyone have an answer in case I don't have a webpack config?
I figured out ... you have to use SendGrid in your backend, not in your frontend. Install this library in your backend service, make the call from your frontend to initiate the backend. the 'fs' library will not work on the frontend.
Those are backend dependencies. It's you're using webpack for a backend service, you'll need to add this to your webpack config: target: 'node'
Most helpful comment
I figured out ... you have to use SendGrid in your backend, not in your frontend. Install this library in your backend service, make the call from your frontend to initiate the backend. the 'fs' library will not work on the frontend.