How to distinguish this error.

I got an email program from sendgrid.com.
https://www.vorbly.com/Vorbly-Code/WIX-SENDGRID-API-V3—AUTO-EMAIL-MESSAGES
After running, the following prompt appears.

I am not very clear about what kind of error this is and how it should be corrected. Hope help.

The following are elements and code at page

the following are code in Backend.

sendGrid.js
import { fetch } from ‘wix-fetch’ ;

export function sendWithService ( key , sender , recipient , subject , body , date ) {
const url = “https://api.sendgrid.com/v3/mail/send” ;

const headers = {
“Authorization” : "Bearer " + key ,
“Content-Type” : “application/json”
};

const data = {

"personalizations" : [{ 
    "to" : [{ 
        "email" :  recipient 
    }] 
}], 

"from" : { 
    "email" :  sender 
}, 

"subject" :  subject , 

"content" : [{ 
    "type" :  "text/html" , 
    "value" :  body 
}] 

};

return fetch ( url , {

"method" :  "POST" , 
"headers" :  headers , 
"body" :  JSON . stringify ( data ) 

})

. then ( response => response . text );

}

email.jsw
import { sendWithService } from ‘backend/sendGrid’ ;

export function sendEmail ( subject , body ) {
const key = “SG._HbV2s-ASU-3qed3_Bz6-Q.uQR2Fa2cOVAVRX20BGtpl57f76eO1LGiDrGR8whz8” ; // Replace with your API key //
const sender = “laizhihong88@gmail.com” ; // Sender email //
const recipient = “jacklai88@yahoo.com” ; // Notification to yourself //
return sendWithService ( key , sender , recipient , subject , body );
}

export function sendEmailWithRecipient ( subject , body , recipient ) {
const key = “SG._HbV2s-ASU-3qed3_Bz6-Q.uQR2Fa2cOVAVRX20BGtpl57f76eO1LGiDrGR8whz8” ; // Replace with your API key //
const sender = “laizhihong88@gmail.com” ; // Sender email //
return sendWithService ( key , sender , recipient , subject , body ); // Customer email //

}

On the sendGrid JS on your site, not your page code, here is some typo (check if there is any red dots on the backend code, not front end)

Do NOT post your API key here! It would leak data to bring you $ loss

I see some black dots not red dots under word key, sender, recipient,… that should not be a problem ?

I change it, now the displaying is not a true API Key, thank you !

Hi there,

The error is telling there’s an unexpected character on line 44. You need to delete it.

  1. Delete “email.jsw” on line 44.
  2. Relocate the import statements to the top of the document.