firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Data Connect event listener ignored on emulator

Open Bindslev opened this issue 2 months ago • 5 comments

Related issues

[REQUIRED] Version info

node: 20

firebase-functions: 7.0.0

firebase-tools:

14.26.0

firebase-admin:

13.6.0

[REQUIRED] Test case

Follow this guide: https://firebase.google.com/docs/functions/data-connect-events

Create a listener:

import { onMutationExecuted } from 'firebase-functions/dataconnect';
import { logger } from 'firebase-functions/v2';

export const someListener = onMutationExecuted(
  {
    region: 'europe-west1',
  },
  (event) => {
    console.log(event.data);
    logger.error(event.data);
  }
);

Trigger any mutation using firebase data connect in the firebase console.

It should work when deployed - but doesn't work on emulator.

[REQUIRED] Steps to reproduce

Follow this guide: https://firebase.google.com/docs/functions/data-connect-events

[REQUIRED] Expected behavior

I expected the event listener to be triggered on mutation on emulator, but it only works on deployment. In fact, locally the emulator logs does not even list the listener here:

"functions Loaded functions definitions from source: ..."

[REQUIRED] Actual behavior

Nothing happens - the trigger isn't registered on emulator and therefore no logs are printed.

Were you able to successfully deploy your functions?

Yes, there it works fine.

Bindslev avatar Nov 23 '25 16:11 Bindslev

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Nov 23 '25 16:11 google-oss-bot

Hi! thanks for raising this, we will investigate and provide updates when available.

cabljac avatar Nov 24 '25 11:11 cabljac

I realized after creating this, that it might just not be supported yet since it's a completely new feature.

A quick-fix could be to add to the documentation that emulator is not supported maybe? At least I expected it to when it wasn't mentioned and spend quite some hours trying to understand why it wouldn't trigger.

Obviously even better would be if it could be supported :D

Bindslev avatar Nov 24 '25 20:11 Bindslev

In case it's true that this functionality is not supported, I have created a wish for it on user voice for others that come across this post: https://firebase.uservoice.com/forums/948424-general/suggestions/50742443-data-connect-event-triggers-on-emulator#comments Upvote and leave a comment if you'd like emulator to be supported

Bindslev avatar Dec 01 '25 12:12 Bindslev

Hey, thanks! I'll raise this with the team to confirm.

cabljac avatar Dec 04 '25 16:12 cabljac