Skip to content
Advertisement

Tag: node.js

JavaScript: dynamic property not showing unless accessed explicitly

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

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

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

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

Advertisement