question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

422 on force send

See original GitHub issue

Describe the bug I am getting a 422 error in the terminal when I force send.

I am also getting the following error popup: image

This is my API route that triggers the sending of the email

//api/sendTestEmail.tsx
import sendMail from "emails";
import ConfirmEmail from "emails/ConfirmEmail";

export default async function handler(req: any, res: any) {

  sendMail({
      subject: "First Test Email",
      to: "personalEmail@hidden.com",
      component: <ConfirmEmail firstName="Amelita" ctaText={"Verify this test email"} callbackUrl={"https://callbackUrl.com/"} />
    });
  }

This is the my emails/index.ts

import nodemailer from "nodemailer";
import { buildSendMail } from "mailing-core";

const transport = nodemailer.createTransport({
  pool: true,
  host: "smtp.postmarkapp.com",
  port: 587,
  secure: true, // use TLS
  auth: {
    user: process.env.POSTMARK_CLIENT,
    pass: process.env.POSTMARK_CLIENT,
  },
});

const sendMail = buildSendMail({
  transport,
  defaultFrom: "workEmail@hidden.com",
  configPath: "./mailing.config.json",
});

export default sendMail;

Finally, this is the preview output

mailing 💌 opening sendMail preview {
  subject: 'First Test Email',
  to: 'personalEmail@hidden.com',
  component: {
    '$$typeof': Symbol(react.element),
    type: [Function: ConfirmEmail],
    key: null,
    ref: null,
    props: {
      firstName: 'Amelita',
      ctaText: 'Verify this test email',
      callbackUrl: 'https://callbackUrl.com/'
    },
    _owner: null,
    _store: {}
  },
  html: 'omitted'
}
API resolved without sending a response for /api/sendTestEmail, this may result in stalled requests.
mailing 💌 opening sendMail preview {
  subject: 'First Test Email',
  to: 'personalEmail@hidden.com',
  component: {
    '$$typeof': Symbol(react.element),
    type: [Function: ConfirmEmail],
    key: null,
    ref: null,
    props: {
      firstName: 'Amelita',
      ctaText: 'Verify this test email',
      callbackUrl: 'https://callbackUrl.com/'
    },
    _owner: null,
    _store: {}
  },
  html: 'omitted'
}

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
elie222commented, Nov 9, 2022

I also get the 422 issue

0reactions
psugiharacommented, Nov 9, 2022

fix released in v0.8.16

Thanks @elie222 and @SSardorf for surfacing.

Feel free to re-open and/or ping me in the discord if you’re still having problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix '422 Unprocessable Entity' when sending a POST ...
I am trying to create a wiki page using redmine rest api. The Authentication was succeeded, however the wiki page is not being...
Read more >
422 Unprocessable Entity - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 422 Unprocessable Entity response status code indicates that the server understands the content type ...
Read more >
http - Is a 422 response ever appropriate for a GET request?
The HyperText Transfer Protocol (HTTP) 422 Unprocessable Entity response status code indicates that the server understands the content type ...
Read more >
Why do I get a Code 422 error when connecting my printer?
To re-register with PrintNode: Open the PrintNode app. The PrintNode Client window appears. User-added image. Navigate to the Accounts tab in ...
Read more >
Penal Code 422 PC - Criminal Threats - California Law
Penal Code 422 PC prohibits you from making criminal threats. This means threats of death or great bodily injury that are intended to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found