Skip to content

Category: Questions

Destructuring a mongoose document

Using mongoose in my project, I ran into a problem. I want to find all documents that have such a key and value pair role: USER. I can get a list of documents, but I cannot get the values of specific fields from it, no matter how I try. Here is my code: The request definitely gets the document, because

Deployed React app to github pages is blank

I’m following instructions from https://github.com/gitname/react-gh-pages to deploy my react app to github pages. At the link I’m getting a blank page though and a 404 error: Failed to load resource: the server responded with a status of 404 () My app works on local host I searched around and its …

Should I return a promise in a JS Service Worker onFetch callback function if I don’t want to do anything with the original request?

My scenario is the following: I have a Progressive Web App that uses a Service Worker where I need to catch the request and do something with it every time the user requests a resource or leaves the current URL I’m handling that through adding a callback to the fetch event of the worker I only care abou…

pointerdown vs onclick: what is the difference?

What is the difference between the onpointerdown and onclick event handlers? Are there any practical differences? Are the events not propagated the same up the DOM tree? Are there some devices that only respond to one of these events? I initially assumed that it is only pointerdown that is triggered in touch …

noteOn is not a function

I have: But then I get an error here: Uncaught TypeError: sourceHuman.noteOn is not a function Why is noteOn method not defined? UPDATE I’m using my HTML audio tag to stream by hls.js: I would like to get the audio streamed by HLS and process it with Web Audio API. According to this post, I guess I woul…