Skip to content

Local Function Emulator Triggering wrong function #4189

Closed

Description

@markdagraca

Trying to run my react typescript project using Local Emulator and it is triggering the wrong function when called from the front end. Code is working perfectly in the production and test environment but not in Local

Activity

  1. markdagraca commented on Feb 17, 2022

    @markdagraca
    Author

    Downgraded to 10.1.5 and it appears to be working properly but I'm now missing env variables features found in 10.2

  2. Albertbol commented on Feb 19, 2022

    @Albertbol

    exactly the same issue for the node js environment, all latest libraries

        "engines": {
            "node": "16"
        },
        "main": "dist/index.js",
        "dependencies": {
            "firebase": "^9.6.7",
            "firebase-admin": "^10.0.2",
            "firebase-functions": "^3.18.1"
        },
    
  3. roobd commented on Feb 20, 2022

    @roobd

    I have the same issue that my function triggers are not working anymore after the upgrade to 10.2.1.
    There is only one onCreate function triggered all the time, even a creation on a completely different document path is triggering this one function.

    A downgrade to 10.2.0. does not fix the issue.

    I use firebase-functions at version 3.18.1

    A downgrade to 10.1.5 is fixing the issue and all triggers are working as expected again.

  4. self-assigned this
    on Feb 22, 2022
  5. taeold commented on Feb 22, 2022

    @taeold
    Contributor

    We are taking a look at the issue. Sorry for the inconvenience!

  6. ggirotto commented on Feb 22, 2022

    @ggirotto

    We were facing the same issue but it stopped happening yesterday.

  7. gustavrannestig commented on Feb 24, 2022

    @gustavrannestig

    I have the same issue. From what I can see the patterin is that it seems to be stuck on the first called function.

    So when I restart the emulators, I can choose what function to use for that "session" by firing that first. But then I can't switch and call another function without restarting.

    So I'm guessing some sort of cache bug? :)

  8. haroldadmin commented on Feb 24, 2022

    @haroldadmin

    Can confirm, facing the same issue that @gustavrannestig described. It keeps triggering the first triggered function for any subsequent API calls.

  9. taeold commented on Feb 24, 2022

    @taeold
    Contributor

    Been investigating the issue, and @gustavrannestig's description helps a ton. Will post an update here once I get a sense of the bug - apologies to everyone for the inconvenience.

  10. zebreus commented on Feb 24, 2022

    @zebreus

    I also have the same issue. The first triggered function is called for any subsequent API calls.
    The first bad firebase-tools version is 10.2.0.
    The issue only happens, when the functions emulator is in debug mode.

  11. taeold commented on Feb 24, 2022

    @taeold
    Contributor

    @zebreus Thanks for a very helpful pointer.

    Is everyone reporting the issue also starting the emulator with --inspect-functions flag?

  12. markdagraca commented on Feb 24, 2022

    @markdagraca
    Author
  13. markdagraca commented on Feb 24, 2022

    @markdagraca
    Author

    What @gustavrannestig said is exactly what I was experiencing

  14. modified the milestone: on Feb 24, 2022
  15. gustavrannestig commented on Feb 25, 2022

    @gustavrannestig

    @taeold yes I'm also running the emulators with --inspect-functions

  16. nikgavalas commented on Feb 25, 2022

    @nikgavalas

    I removed the --inspect-functions flag and everything seems to work just fine. If I add it in I can confirm that the issue occurs again. Hopefully that helps in tracking down the fix!

  17. doo-gl commented on Feb 28, 2022

    @doo-gl

    Similar issue, starting the emulator, it will repeatedly run whatever was the initial function regardless of what path is used.

    Downgrading to 10.1.5 resolves the issue for now.

    For those looking for what to do, run:

    npm install -g [email protected]
    

    check your running version is 10.1.5 using

    firebase --version
    

    If it is still 10.2.x, restart your terminal.

  18. taeold commented on Mar 3, 2022

    @taeold
    Contributor

    Hi folks. The patch for this issue was released today in firebase-tools v10.2.2. Please give it a spin and let us know if things are working expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions