I have firebase cloud schedule function. It works fine for the first two periods, but then it stops. my function codes are below. I am not experienced in javascript. Is there any mistake in my codes? I am attaching the logs. 12:07:04.314 AM -> worked fine 6:07:03,658 AM -> worked fine 12:07:04.314 PM -&…
Tag: node.js
How do I add parameters to https get request?
I am working on a little project to learn how to work with APIs by making GET requests to the Twitter API v2 via a node server. For the get requests I am using Node’s built in https package. I made a basic GET request that returns a list of the last 10 tweets from a user. I think in
Node.js throws TypeError: Cannot destructure property ‘firstName’ of ‘req.body’ as it is undefined, even though it works for an other post request
So I know there are tons of similar questions out there, and I’ve read most of them in the past few days. However I didn’t find any solution to my problem. The app is about users can post memories(cards) etc… Point is, when I create a new card with POST request, there is no problem, but when…
UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘voice’ of undefined. In play.js when trying to run a command
I get the error UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘voice’ of undefined in my code. Is it a problem with dependencies or is it an error in the code. This is my code. This is my bot.js code This is a music command which i am trying to make an requires you to be in a v…
How to select random object from JSON file in discord.js
I’ve done some searching around and I found some posts on here but my code doesn’t want to work. Basically I’m making a discord bot and I want to select an object from a JSON file at random. This is my command: And this is my JSON file: If I want put the objects in the command manually and t…
How to make a function in Node JS run only once
I am creating a simple tictactoe terminal game in JS. I use the variable named player1Input to get user prompt. If the prompt is not equal to “X”, I call the function again to make sure the user input the right input. If I enter the wrong input multiple times, the function (player1Game) ends up be…
How can I connect to a Metamask wallet using ethers.js from a standalone node.js application?
I can’t figure out how to do this. I have seen some documentation talking about ethers.Wallet.fromMnemonic, but how does ethers know my wallet is a metamask one? Or, if the wallet provider is irrelevant (is it?) how does it know its address? Does it make any difference that I want to then interact with …
Is there a cleaner way to await an https.get?
I stumbled across this post while looking for a way to await reading a file with fs. I was surprised that I hadn’t seen it anywhere else: Is there a way to use await in the same manner shown above, but for the ‘https’ library? I didn’t see anything like .promises and I was hoping to av…
Better way to schedule cron jobs based on job orders from php script
So I wrote simple video creator script in NodeJS. It’s running on scheduled cron job. I have a panel written in PHP, user enter details and clicks “Submit new Video Job” Button. This new job is saving to DB with details, jobId and status=”waiting” data. PHP API is responsible for…
Tailwind CSS does not work with React App
I am trying to add tailwind css with react app. I followed the tailwind documentation,how to set up tailwind with react. I tried with tailwind latest version.I checked Nodejs and npm are installed perfectly. But when i run the npm run start it always get an error. I can’t fix the problem. package.json P…