Giter VIP home page Giter VIP logo

Comments (12)

s2young avatar s2young commented on July 25, 2024

Tracing this through, it appears to fail here:
https://github.com/firebase/firebase-functions/blob/master/src/providers/database.ts#L112

Where nothing is passed into the 'resourceToPath' function.

from functions-samples.

s2young avatar s2young commented on July 25, 2024

And to be clear, I'm trying to mock a data removal. I've tried passing many different strings into the 'path' parameter (though it's marked as optional in the function signature).

from functions-samples.

laurenzlong avatar laurenzlong commented on July 25, 2024

Have you required lodash as a dependency for your functions? If so, what does your package.json look like?

Also, can you print out the result of these commands?

fakeEvent.data instanceof functions.database.DeltaSnapshot
_.deepClone(fakeEvent).data instanceof functions.database.DeltaSnapshot

from functions-samples.

s2young avatar s2young commented on July 25, 2024

I added lodash, with no change in result. The functions return true, true.

I REALLY appreciate your help!

from functions-samples.

s2young avatar s2young commented on July 25, 2024

{
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"async": "^2.1.4",
"firebase": "^3.7.1",
"firebase-admin": "^4.1.3",
"firebase-functions": "^0.5.2",
"lodash": "^4.17.4",
"validator": "^7.0.0"
},
"private": true
}

from functions-samples.

laurenzlong avatar laurenzlong commented on July 25, 2024

Everything appears to be right. That's really strange you're still getting that error.

Did you call myFunctions.userChange anywhere else in your test code? Or do you call userChange anywhere else in index.js?

from functions-samples.

laurenzlong avatar laurenzlong commented on July 25, 2024

Also, just to clarify, a lodash dependency is not actually needed. Since firebase-functions already depends on it so it gets automatically installed. I was just ensuring that you did not have a conflicting dependency on lodash that was another version. So you can now remove lodash from package.json if you'd like.

from functions-samples.

s2young avatar s2young commented on July 25, 2024

userChange is only called once in my test. And only once in userChange. Thanks

from functions-samples.

laurenzlong avatar laurenzlong commented on July 25, 2024

"And only once in userChange. " - do you mean that your userChange function recursively calls itself?

from functions-samples.

inlined avatar inlined commented on July 25, 2024

Just a friendly ping that we're eager to help and waiting for a response @s2young

from functions-samples.

s2young avatar s2young commented on July 25, 2024

No it's not recursive. I was probably half-asleep when typing that!

from functions-samples.

laurenzlong avatar laurenzlong commented on July 25, 2024

Haha, no probs. Thanks for the clarification! Can you try updating your SDK to the newest version and see if the problem is still there? (v.0.5.4)

from functions-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.