Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
problem deploying firebase cloud function

I keep getting this error " 26:7 error Parsing error: Unexpected token function" in my command line whenever i try to deploy firebase cloud function using the "firebase deploy" command, please help this is my index.js code

'use strict'

const functions = require('firebase-functions');
const nodemailer = require('nodemailer');

const gmailEmail = functions.config().gmail.email;
const gmailPassword = functions.config().gmail.password;

const mailTransport = nodemailer.createTransport({
    service : 'gmail', 
    auth : {
        user: gmailEmail,
        pass: gmailPassword
    },
});

const APP_NAME = 'Instagram Clone'

exports.sendWelcomeEmail = functions.auth.user().onCreate((user)=>{
    const email = user.email;
    const displayName= user.displayName;

    return sendWelcomeEmail(email, displayName);
});

async function sendWelcomeEmail(email, displayName){
    const mailOptions = {
        from : `${APP_NAME} <noreply@firebase.com`, 
        to : email,
    };

    mailOptions.subject = `Welcome to ${APP_NAME}!`;
    mailOptions.text = `Hey ${displayName || ''}! Welcome to ${APP_NAME}, shit stressing me out`;

    await mailTransport.sendMail(mailOptions);
    console.log("Email sent to", email);

    return null;


    
}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!