You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to setup Resend in an express project that is on Node version 17
Im on the latest version of Resend v2.0.0
When running the project I get an error saying:
"ReferenceError: Headers is not defined",
" at new Resend (/var/task/node_modules/resend/build/src/resend.js:34:28)",
The line referenced begins here: ... this.headers = new Headers({ Authorization: Bearer ${this.key}, 'User-Agent': userAgent, 'Content-Type': 'application/json', }); ...
where you're using the Headers interface of the fetch API. Unfortunately this is only supported in Node version 18 and greater. I don't think I saw anything in your documentation while getting setup that Node version 18 was a requirement. Will you ever offer some sort of backward compatibility?
When I clone this resend-express-example project I don't see this error, but it looks like the Resend version that gets downloaded is version 0.17.1 where the Headers interface isn't being used. What version was this implemented? Is it recommended that I roll back instead of waiting for support in the latest version?
The text was updated successfully, but these errors were encountered:
I ended up just bumping my project node version to 18. If you need this to work and you aren't able to update your node version for some reason you could just roll back to an earlier version of resend (not sure what version this was implemented but you could find out digging through the commit history) or submit an MR that replaces the Headers interface so it's more backward compatible.
Unfortunately I was locked to Azure's Node 16 but I switched into a container environment and it's all good now. I didn't try downgrading the package though. Thanks for your contribution!
Im trying to setup Resend in an express project that is on Node version 17
Im on the latest version of Resend v2.0.0
When running the project I get an error saying:
The line referenced begins here:
... this.headers = new Headers({ Authorization:
Bearer ${this.key}, 'User-Agent': userAgent, 'Content-Type': 'application/json', }); ...
where you're using the Headers interface of the fetch API. Unfortunately this is only supported in Node version 18 and greater. I don't think I saw anything in your documentation while getting setup that Node version 18 was a requirement. Will you ever offer some sort of backward compatibility?
When I clone this resend-express-example project I don't see this error, but it looks like the Resend version that gets downloaded is version 0.17.1 where the Headers interface isn't being used. What version was this implemented? Is it recommended that I roll back instead of waiting for support in the latest version?
The text was updated successfully, but these errors were encountered: