firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
882 stars 372 forks source link

🐛 [RESIZE IMAGES] Not creating any eventarc triggers after enabling events #1949

Closed CalvinJamesHeath closed 4 months ago

CalvinJamesHeath commented 4 months ago

[REQUIRED] Step 2: Describe your configuration

[REQUIRED] Step 3: Describe the problem

I want to get event onSuccess event when the image is finally resized.

`exports.onimageresized = onCustomEventPublished( 'firebase.extensions.storage-resize-images.v1.complete', (e) => { console.log('EVENT', e); console.log('it works!', JSON.stringify(e)); functions.logger.info('LOGGEr', e); }, );

exports.eventhandler = onCustomEventPublished( 'firebase.extensions.storage-resize-images.v1.onSuccess', (e) => { console.log('EVENT onSuccess', e); functions.logger.info('eventhandler logger', e); // Handle extension event here. }, );`

Even though I have all permissions enabled, none of the functions are called. There aren't any active triggers on the EventArc panel of the Google Console, and the triggers aren't included on the Firebase channel either. Along with trying to create new triggers, I also enabled admin pub sub access. After that, I tried again, but it didn't work, so I deleted the extensions and installed again and gave it another shot.

I still don't see any triggers or channel triggers created, nor do I see any console.logs in the log explored.

CalvinJamesHeath commented 4 months ago

Even after a succesful deploy, the functions are never created in the functions tab.

I can deploy new functions like: exports.test = functions.firestore .document('test/{documentId}') .onDelete((snapshot, context) => { console.log('test works'); }); And confirm it exists in the functions tab.

However, the following is never deployed aparently. exports.onrezised = onCustomEventPublished( 'firebase .extensions.storage-resize-images.v1.onSuccess', (event) => { functions.logger.info('Resize Image is successful', event); // Additional operations based on the event data can be performed here return Promise.resolve(); }, );

CalvinJamesHeath commented 4 months ago

The solution is to ensure that you are using the latest version of the Firebase CLI. You can check the version by running firebase --version in your terminal.

If you're not on the latest version, consider upgrading with npm install -g firebase-tools.

That also created all the triggers in eventArc.