Next.js Discord

Discord Forum

Emailjs no location defined

Unanswered
Rex posted this in #help-forum
Open in Discord
RexOP
After sending an email:
ReferenceError: location is not defined

5 Replies

@Rex After sending an email: ReferenceError: location is not defined
could you show some code
@Ray could you show some code
RexOP
I discovered that when you try to send en email from a server side page, it gives you this error.
It only works in client-side for me.
So the code that I put inside the page is like this:
emailjs.
send(
  serviceID, 
  templateID, 
  params:{}, 
  publicKEY).
  then((result) => console.log(result.text); )
Since its a client side component, thats the reason you are getting the error