Skip to content
Advertisement

Tag: async-await

how to auth user using async and await in firebase

I have a simple app in Vue.js that authenticates existing users in firebase. So far it works but I want to make it using async and await instead of then? How can I rewrite my logic using async and await instead? I looked at the docs but didn’t find any information, here is my code: Answer define the property as

Why is this promise returning undefined?

I am trying to write a simple function like this and I have made a firebase helper like this however, league is logging out as undefined and in here is logging out second. however, I thought it would be the other way around? I thought it would “await” for this function to resolve then once it’s resolved, it would show

Unexpected unhandledRejection event for promise which rejection does get handled

Updated, I’ve now tried explaining the behavior I’m seeing, but it’d still be great to have an answer from a credible source about the unhandledRejection behavor. I’ve also started a discussion thread on Reddit. Why do I get an unhandledRejection event (for “error f1”) in the following code? That’s unexpected, because I handle both rejections in the finally section of

Node child_process await result

I have a async function which makes a face_detection command line call. It’s working fine otherwise, but I can’t make it to wait for the response. Here is my function: isThereFace in my response I return is always undefined because the response is sent to client before the response from face_detection is ready. How could I make this work? Answer

script ends despite unresolved promise

Consider this: The scripts terminates at the await and the log is never printed to sdout, I don’t understand why Answer Nothing is wrong with your code. That’s just the model of Node. If there is no pending I/O pending promises don’t prevent Node from exiting. You can schedule some I/O if you want to stop Node from exiting but

Advertisement