We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When i am using node v16 then it is throwing an error - ReferenceError: Headers is not defined
ReferenceError: Headers is not defined
use node version - v16.20.2
v16.20.2
require('dotenv').config(); const { Resend } = require('resend'); const express = require('express'); const resend = new Resend(process.env.EMAIL_API_KEY); const app = express(); app.get('/', async (req, res) => { try { const data = await resend.emails.send({ from: 'Acme <[email protected]>', to: ['[email protected]'], subject: 'Hello World', html: '<strong>It works!</strong>' }); console.log(data); res.status(200).json({ msg: 'email sent' }); } catch (err) { console.log(err); res.status(400).json({ msg: 'email not sent' }); } }); const PORT = process.env.PORT || 8000; app.listen(PORT, () => console.log('Server running on Port - ' + PORT));
I updated the node version to 18.13.0 and it worked.
18.13.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue
When i am using node v16 then it is throwing an error -
ReferenceError: Headers is not defined
How to reproduce
use node version -
v16.20.2
Code snippet
Error Screenshot
Alternative Fix
I updated the node version to
18.13.0
and it worked.The text was updated successfully, but these errors were encountered: