Getting the following error when trying to send a verification e-mail: ```[INFO] 05:38:57 ts-node-d...
c

corgitaco

almost 2 years ago
Getting the following error when trying to send a verification e-mail:
[INFO] 05:38:57 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.2, typescript ver. 4.9.5)
API Server listening on port 3001
Error: 140384285034368:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
where my smtp settings are:
ts
let smtpSettings = {
    host: "mail.privateemail.com",
    authUsername: "no-reply@website.com",
    password: "password",
    port: 587,
    from: {
        name: "Website No Reply",
        email: "no-reply@website.com"
    },
    secure: true
}
Tried switching to port 465 as well but that times out the connection w/ a 504 error and has the following server side error after 2 minutes:
Error: Connection timeout
    at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
    at SMTPConnection._onError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:776:20)
    at Timeout.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:235:22)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)
I tried testing it in java like so and this does work: Ran some [tests]() on . so not sure what I'm doing entirely wrong on the NodeJS back end not sure if relevant at all but I am using NameCheap's mail service (
privateemail.com
) with the DNS handled through Cloudflare. Followed the instructions Namecheap provides [here]() & [here]() Hope that's everything you might need to assist me with my issue
Hey guys, does the new Sentry version for Next.js also co-exist with Supertokens already? I believe...
r

robschilder

almost 3 years ago
Hey guys, does the new Sentry version for Next.js also co-exist with Supertokens already? I believe in version 7.14.0 of Sentry, the SDK will automatically instrument API routes and server-side Next.js data fetching methods with error and performance monitoring.(https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/) After updating to
"@sentry/nextjs": "7.31.1"
and
"supertokens-node": "^13.0.2"
, I realised that the API routes were giving a 500, with the following message:
2023-02-25T17:38:56.455Z    c7afa71e-b4f9-4cad-971c-e1145720392c    ERROR    Uncaught Exception     {"errorType":"Error","errorMessage":"write after end","trace":["Error [ERR_STREAM_WRITE_AFTER_END]: write after end","    at new NodeError (node:internal/errors:387:5)","    at ServerResponse.end (node:_http_outgoing:968:15)","    at ServerResponse.apiRes.end (/var/task/node_modules/next/dist/server/api-utils/node.js:356:25)","    at ServerResponse.res.end (/var/task/node_modules/@sentry/nextjs/cjs/server/wrapApiHandlerWithSentry.js:152:26)","    at processTicksAndRejections (node:internal/process/task_queues:96:5)"]}
Unknown application error occurred
Runtime.Unknown
The solution now is to temporarily disable the automatic instrumentation of API route handlers and server-side data fetching functions by setting the
autoInstrumentServerFunctions
to false.
const moduleExports = {
  sentry: {
    autoInstrumentServerFunctions: false,
  },
};
Now it's still possible to to only wrap specific API route handlers or data fetching functions instead. For API routes, they use the
wrapApiHandlerWithSentry
function. But ideally we would want Sentry to work with Supertokens out of the box. Have you guys looked into this already?