I’m using NodeJs, I’m creating a dynamic property inside an object, and then pushing it into an array. The problem is, when I access the variable via console.log(object[dynamic_property_name]) I can see it in the console, but when I console.log(object) the dynamic property doesn’t show. here is the code, the property in question is teachers_matieres in the element object. PS: I
Tag: node.js
Puppeteer .click hovers instead of clicking
I am using puppeteer to automatically restart my wifi (Linksys Velop) and I can’t seem to click an anchor tag to make the final dialog pop up. After the element is clicked, the anchor tag looks as if it’s being hovered over, with the blue underline. Here is the relevant markup: I have tried page.click() as well as page.$eval(), changing
Read all .md files, convert them to html and send them
I use fs to read the file which is in .md format and I want to transform it into html file. This is my code so far: the file is situated in that folder and has that name. This function puts in console the content of the .md file. For converting it to html I added this: It puts the
Use gulp files from other npm packages (import files which will eventually exist)
I have one npm package containing several files with several gulp task definitions. What I want is in the main gulpfile, be able to copy these gulp files (from the package) and execute the gulp tasks defined in them. Follows an example: The problem is: When I try to execute gulp debug, it is retrieved an error saying require(‘../src/generated-code/gulp/gulp.debug’) does
How to make Discord Bot make sure your pinging someone in a command
I’m trying to make the bot say the name of someone I pinged and give that person a role. Right now, if you don’t ping someone, the whole bot breaks. Here is my code: Answer I see a few problems with your code: First of all, else if() will always return an error. Second of all, you should switch this
Some of the Express public files are not accessible on localhost
When I run my Node.js app on localhost, I can access for example http://localhost:3000/css/dashboard.css However, if I put a logo.png to the same directory and try http://localhost:3000/css/logo.png on my browser, I only get “Cannot GET /css/logo.png”. I tried with several browsers. In my app, the only reference to this is: expressapp.use(express.static(__dirname + ‘/public’)); The files are in a public directory
Why am I getting this UNEXPECTED HTTP error in NodeJS
So guys i’m setting up my backend in NodeJS for an e-commerce website. But I ran into an error trying to implement the “Order” method. First the connection to mysql database : Then in my Models there is a Client class that contains the following method : The orderData parameter in the order() method is a JSON posted from the
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
discord.js setting permission on channel to “/” (neutral)
I am looking to set user permissions on a text channel to neutral/null/”/” but overwritePermissions() seems to only use allow and deny currently, a past post I saw showed setting the value to null but allow/deny seems to prevent that. I am setting permissions on a text channel like this: and would like to effectively undo this action, changing the
cors error even after allowing all origins *
i have a post request on my at http://localhost:3000 and request resources from http://localhost:5500 even after allowing all origins it gives error. I’m stuck on this for a few hours now please help. i get this error this is where i’m setting my header this is my fetch request Answer Try below. Added a condition to check if the request