-
Notifications
You must be signed in to change notification settings - Fork 260
adding missing code in a snippet #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
718eb74
to
7349872
Compare
@devkiloton Thanks for your contribution. The build is failing because you're not supposed to edit that file directly. So the best solution here would be to move that snippet comment to the start of the function so that the imports are shown: function writeNewPost_wrapped() {
// [START rtdb_social_write_fan_out]
const { getDatabase, ref, child, push, update } = require("firebase/database"); |
@devkiloton Please also undo the change that you made to the generated file. |
Thanks @thatfiredev! I can't believe that the answer for the problem was literally in my screen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@thatfiredev should not I create a commit with the generated file? "npm run snippets" will do that. |
@devkiloton Oops, my bad! Seems like you're right, please do commit the generated file. |
Head branch was pushed to by a user without write access
Thanks for the support @thatfiredev! |
@devkiloton the change is now live in the docs. 🎉 |
@thatfiredev dude, this is insane! Firebase has a piece of me now haha! Thanks for the support again! |
In the firebase documentation for writing and reading data there is a code snippet (the only one actually) that does not have the necessary imports. I spent a few hours on stack overflow looking for the problem because I was getting errors in my React Native app, but it was actually the documentation that did not say I had to do the imports.
The snippet is in the "Updating or deleting data" section
https://firebase.google.com/docs/database/web/read-and-write#updating_or_deleting_data