I'm setting up the env for local development and just testing to see if the emulators are working but my simple test is failing without any errors.
// functions/index.js
exports.pdftoimg = functions.storage.object().onFinalize(async (object) => {
console.log({ object });
});
Emulators start without issues:
firebase emulators:start
i emulators: Starting emulators: auth, functions, firestore, hosting, pubsub, storage
✔ functions: Using node@16 from host.
i hosting: Serving hosting files from: dist
✔ hosting: Local server: http://localhost:5002
i functions: Watching "/Users/xxx/Code/myApp/functions" for Cloud Functions...
✔ functions[us-central1-pdftoimg]: storage function initialized.
┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
│ i View Emulator UI at http://localhost:4000 │
└─────────────────────────────────────────────────────────────┘
But when I upload a test pdf file to storage emulator using the UI (http://localhost:4000/storage/default-bucket) nothing is displayed in the logs.
I tested the cloud triggers for Firestore Db but that seems to work though.
What am I missing?
Thanks