Skip to content
New issue

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

Cannot set headers after they are sent #259

Open
andreasvirkus opened this issue Oct 30, 2024 · 0 comments
Open

Cannot set headers after they are sent #259

andreasvirkus opened this issue Oct 30, 2024 · 0 comments

Comments

@andreasvirkus
Copy link

andreasvirkus commented Oct 30, 2024

Currently calling

const mail = useMail()

await mail.send({
  from: 'Website',
  subject: 'Form',
  text: `${name.value}
E-mail: ${email.value}
Msg: ${message.value}`,
})

Results in a 500 error logged (only on prod), it works fine locally. Is the API_URL env still required or the axios dependency? From the docs it's hard to tell if that's only for Nuxt 2 or also for Nuxt 3

Error:

homepage-2    | [nuxt] [request error] [unhandled] [500] Cannot set headers after they are sent to the client
homepage-2    |   at ServerResponse.setHeader (node:_http_outgoing:699:11)
homepage-2    |   at setResponseHeaders$1 (./.output/server/chunks/runtime.mjs:1751:20)
homepage-2    |   at Object.handler (./.output/server/chunks/runtime.mjs:5643:7)
homepage-2    |   at Object.handler (./.output/server/chunks/runtime.mjs:2270:31)
homepage-2    |   at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
homepage-2    |   at async Server.toNodeHandle (./.output/server/chunks/runtime.mjs:2540:7)

The response of the /send/mail API endpoint in the browser's dev tools is

message: "Missing credentials for \"PLAIN\""
stack: ""
statusCode: 500
statusMessage: "Missing credentials for \"PLAIN\""
url: mail/send"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant