I'm going crazy over "writing stuff exactly what the documentation wants but came back with different outcome."
I'm trying to import firebase to my express.js API so the app can GET directly from the database.
// Initialize Firebase
const functions = require('firebase-functions');
import { initializeApp } from 'firebase/app';
const firebaseApp = initializeApp(firebaseConfig);
const db = getFirestore(firebaseApp);
... //some other code
I've looked for the solution at https://firebase.google.com/docs/web/setup and SyntaxError: Cannot use import statement outside a module Firebase Functions
but seems like the problem is pretty different. The outcome still 'SyntaxError: Cannot use import statement outside a module.'
Can anyone explain what happened? Did I miss something?