-
Notifications
You must be signed in to change notification settings - Fork 26
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
Running firebase deploy
results in Error: functions predeploy error: Command terminated with non-zero exit code2
#33
Comments
Looks like this is the same error as firebase/firebase-functions#404. It's a really long and messy thread, so you don't have to read the whole thing, but the cause of the error is you're running a different version of typescript than the one that Functions expects. Can you share the versions in your |
@morganchen12 : I resolved my issue using 3 steps:
After this change, running
which suggested either a mistype on my end or a change in how typescript evaluates code. This stackoverflow question helped me figure out what to do. Thus the new contents of my index.ts file are:
Let me know what you think. Thanks PS: the force unwrapping of the values makes me nervous. Is this the recommended way to do this? I could leave things like this for now till I wrap up the workshop and then look further into Typescript BUT if you have any insights that would be greatly appreciated as it would speed up my learning. Thanks |
Thanks for investigating, looks like the Typescript in the codelab needs to be updated. The unwrapping is not the best way to do this, because it creates a tight coupling between your server function and the client. For example, in the review update handler, this line: const eventData = change.after!.data(); will break if you ever add a feature to delete reviews to the app, since Functions makes this easier since deploying is pretty easy and the functions themselves are stateless. So you could just add the force-unwraps as they are now and then just change them when you want to update your app. In the case of a few force-unwraps, this is only viable because removing the unwraps and handling the error case is easy. |
I am getting this same error. I went through and updated my dependencies in my package.json, but that didn't work. |
@C2SO can you file a new issue with your compiler/linter error? |
No solution to this yet? |
same problem !! |
Same problem, appeared out of nowhere.. Haven't changed a bit in the code. |
Same problem |
Try running "firebase init hosting" before the deploy command |
Device: MacBook Pro
Operating system version: macOS Catalina (version 10.15.1)
Swift version:
Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9) Target: x86_64-apple-darwin19.0.0
Node Version:
node v12.14.0 (npm v6.13.4)
Firebase --version
7.10.0
What steps will reproduce the problem:
What is the expected result?
firebase deploy
should result in success with terminal output ofDeploy complete!
What happens instead of that?
running
firebase deploy
results in error with terminal output:Contents of debug.log
The text was updated successfully, but these errors were encountered: