title: Firebase v9 and Nuxt 2.15.8 - SyntaxError: Cannot use import statement outside a module
body: <p>I'm migrating my codebase to use the firebase version 9 SDK and started to get this error once I started using v9 firestore. I've already migrated the auth part of my and that works perfectly.</p>
  <p>I should note, this only happens when I'm statically generating my website (<code>npm run generate</code>) but not when building the site for SSR (<code>npm run build</code>). During development (<code>npm run dev</code>) I get no errors. The error turns up for every page that has to be generated. It seems to be referencing the <code>messaging</code> module but I'm not using <code>messaging</code> on every page. See an example of the error below:</p>
  <pre><code> ERROR   /faqs
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  </code></pre>
  <p><code>nuxt.config.js</code></p>
  <pre><code>  plugins: [
      {src: '@/plugins/firebase',ssr: true },
    ]
  </code></pre>
  <p><code>plugins/firebase.js</code></p>
  <pre><code>import firebase from 'firebase/compat/app'
  import 'firebase/compat/firestore'
  import 'firebase/compat/storage'
  import 'firebase/compat/messaging'
  import 'firebase/compat/functions'
  
  
  /*********************************** VERSION NINE ********************************** */
  import { initializeApp, getApps } from &quot;firebase/app&quot;;
  import { getAuth } from &quot;firebase/auth&quot;;
  import { getAnalytics } from &quot;firebase/analytics&quot;;
  import { getFirestore } from &quot;firebase/firestore&quot;
  
  const firebaseConfig = {
    apiKey: '',
    authDomain: '',
    databaseURL: '',
    projectId: '',
    storageBucket: '',
    messagingSenderId: '',
    appId: '',
    measurementId: ''
  };
  
  let firebaseApp;
  
  const apps = getApps();
  if (!apps.length) {
    firebaseApp = initializeApp(firebaseConfig);
  } else {
    firebaseApp = apps[0];
  }
  
  const db = getFirestore(firebaseApp, {});
  const auth = getAuth(firebaseApp);
  
  if(process.browser){
    const analytics = getAnalytics(); //enable analytics
  }
  /*********************************** END OF VERSION NINE ********************************** */
  
  
  /*********************************** VERSION EIGHT ********************************** */
  if(!firebase.apps.length){
      const config = {
          apiKey: '',
          authDomain: '',
          databaseURL: '',
          projectId: '',
          storageBucket: '',
          messagingSenderId: '',
          appId: '',
          measurementId: ''
      };
      firebase.initializeApp(config);
      
  }
  
  
  const fireDb = firebase.firestore();
  const fireStorage =firebase.storage();
  const fireFunctions =firebase.functions();
  
  let fireMessage = '';
  if(process.browser){
  
    if(firebase.messaging.isSupported()){
     
      fireMessage= firebase.messaging();
    }
    else{
        
      console.warn('[WARNING] Firebase Cloud messaging not supported');
    }
  
  }
  /*********************************** END OF VERSION EIGHT ********************************** */
  
  export{fireMessage, fireDb, fireStorage, fireFunctions, auth, db}
  </code></pre>
  <p>I'd really appreciate some guidance on this matter. There was a <a href="https://lupas.medium.com/firebase-9-beta-nuxt-js-981cf3dac910" rel="nofollow noreferrer">tutorial</a> I was following, the code is at <a href="https://github.com/lupas/firebase-beta-9-nuxt" rel="nofollow noreferrer">this link</a>. I cloned that project and ran <code>npm run generate</code> successfully so I don't think the error is with firebase? I've appended what was left of the build log below (it was really long so the terminal doesn't have the full log):</p>
  <pre><code>i Full static generation activated
  i Generating output directory: dist/
  i Generating pages with full static mode
  
   ERROR   /about
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /faqs
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /legislation
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /references
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /vaccinationsites
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/addevent
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/addinitiative
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/addsite
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/dashboard
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/deploy
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/login
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/notifications
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/sitelocations
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /admin/updatestatistics
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  
   ERROR   /
  
  C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging\dist\index.sw.esm2017.js:1
  import '@firebase/installations';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\@firebase\messaging-compat\dist\index.cjs.js:8:10)
      at Module._compile (node:internal/modules/cjs/loader:1101:14)    
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)     
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (C:\Users\simeon.ramjit\Documents\projects\covid19-tt\node_modules\firebase\compat\messaging\dist\index.cjs.js:3:1)
  
  √ Client-side fallback created: 200.html
  √ Static manifest generated
  i Generating sitemaps
  √ Generated /sitemap.xml
  √ Generated /sitemap.xml.gz
  </code></pre>