title: SyntaxError: Cannot use import statement outside a module Firebase Functions
body: <p>I'm, having an issue with my Firebase function. I'm getting the below error. </p>
  
  <blockquote>
    <p>SyntaxError: Cannot use import statement outside a module</p>
  </blockquote>
  
  <p>below is my code: </p>
  
  <pre><code>import * as functions from 'firebase-functions';
  import * as sgMail from '@sendgrid/mail';
  
  sgMail.setApiKey(key);
  
  export const weeklyReminder = functions.pubsub.schedule('every Wednesday 21:00').onRun(async context =&gt;{
  
      const msg = {
          to: 'email@gmail.com',
          ...
      };
      return sgMail.send(msg);
  
  }); 
  </code></pre>
  
  <p>How do you import into firebase functions? </p>