I am beginner at NodeJS and I’m doing a “NodeJS and Express.js full course” at freecodecamp yt and I copied author code which for him works perfectly, but I got an error. Code: I don’t know why he got home, about and error page when user goes to the wrong page it should throw “Er…
Tag: node.js
How to map through array of objects to extract objects value?
i am trying to map through an array of objects to extract some value from each object. When i run my code i am getting a result of undefined on console.log(open) but get all the data get log for the console.log(data) Can someone tell me why is it undefined or what is wrong in my code? thanks in advance Data
Trying to run express node js as https server but it won’t run
I’m trying to get HTTPS working on express.js for node, and it won’t run. This is my server.js code. When I run it reports no errors but it just get stuck to nothing (I waited 30 minutes to see if it does something and nothing happened). Answer httpServer.listen(8080, ()=>{console.log(‘Se…
Server data coming through as [Object object] on client
I’m trying to display my data being sent from the server but it’s not coming through properly (see [Object object] in the bottom left of the image above). Here’s the client side code: The server is sending the data in an array in below format: I want the values from totalGuests and attendedG…
Should I use worker or child processes to run my function?
I have two files, main.js and job.js. When a button is clicked in main.js, I want a new, seperate process of the function in job.js to run. What this process does is launch a new puppeteer browser instance. When the stop button is clicked, this process should be killed by pid. (For this we use process.kill(ch…
Discord.js v13 Announce an Annoucement to a certain Channel
Expected I want to make a command that sends a certain message, given from a user (an admin) to a specific channel. What is going on I tried to send a reply to the user who invoked the command with the args they entered. Secondly, I made it so, that it joins every arg into an array and then replies
Knex multiple primary key in a identify relationship where id is an auto increment column
I tried to use every single logic in my mind to resolve this problem, but this is the only solution that it worked. Answer This topic isn’t a question, this is the way that I found to solve the problem using multiple primary key, where an id is auto_increment in the table.
Axios Undefined Response
I am Developing MERN Stack Project. The problem is when I make the first API Call the first response is undefined and the map function gives an error ‘Map is not a function and it makes sense. the problem is i tried several approaches to prevent this from happening but it won’t work This is the Co…
Firebase – How to extend FirebaseError?
I am implementing a cloud function for signing up with unique username and password. In order to throw exceptions, I was previously doing the following: signUpValidation.js signUp.function.js But, I don’t really like this way of throwing the exceptions in the signUpValidation module… it makes more…
Node.js Canvas image overlapping issue / canvas is creating image on top of previous image
I’m having an issue with Canvas when trying to create a generated collection of .png images. I can create the .png files fine but the first image or the image before is not being cleared. index.js config.js The code is working fine and I’m able to create 10 .png files. From the images above you ca…