Category "javascript"

How to access a function defined as key of an object from within another function defined as key of same object in JS

Given below code, I need to reuse functionality from innerFunc1 and innerFunc2 in innerfunc3, but I am not sure, how innerFunc1 and innerFunc2 can be accessed i

Using SocketIO with Unity Quest 2 vr as client and Node.JS as server

Me and my team are building a VR game for the Quest 2 with Unity written in C#. We have a program that is the server that is written in JavaScript (Node.JS), th

Upload single image from axios to FastAPI: "Expected UploadFile, received: <class 'str'>"

I try to upload an image from my react-admin app to FastAPI using axios. The ImageInput component returns a File object which I cast to a Blob and try to upload

using Damerau-Levenshtein distance to compare sets of text in code.org

Not very knowledgeable with coding, I usually use block coding and not typing. I've used many different Levenshtein distance codes I've found online and most of

Dynamically added svg iamge not visible in Angular

I tried to add svg image on my application but it's not visible. The image link is coming from the backend. I tried multiple ways but nothing is working. 1st wa

Next.js ISR pass additional data to getStaticProps from getStaticPaths

In SingleBlogPost.jsx i have: export async function getStaticPaths() { const res = await fetch("http://localhost:1337/api/posts"); let { data } = await res.

Getting expected a function error in Lodash's flow

I need to use lodash's flow function in my project and started learning from an example below it looks ok but getting Expected a function error. Source Code:

React Router Dom v6 - Image not found in nested routes

In my tsconfig.json file, I have a "compilerOptions":{baseUrl} that enables me to look for images in public/images/foo.png like this <img src='images/foo.png

TypeError: Cannot read properties of undefined (reading 'email')

I'm trying to authenticate user. Sign-up is working fine but in sign-in req.body.email is undefined and I can't figure out why. Here is my code for sign-in: rou

Material Icon showing as the name when site first loads

There is an issue with Angular 7 and materials icon where the name of the icon shows when the site is initially loading. Is there a way to prevent this

How do I migrate Angular from 10 to 12 in a correct way> [closed]

I am working on Angular project migration. Initial project was Angular 10 -based and now I am migrating it to Angular 12. But the project is n

Pausing and resuming option in azure blob upload using javascript

How to pause the on progress upload of browser files to azure storage account and resume when required using azure storage blob javascript(v12) library file? I

express-jwt - typeError: done is not a function

I'm using express-jwt to control the user privileges of my startup project, but I'm getting an error when I try to request access (using Postman) an api that on

Button onClick not working in React x Laravel

Hello everyone i am quite lost right now, in my other react projects onClick is working just fine but now with my new app laravel with react i cannot do an Oncl

Structure formData in an array

I have an extensive form and I'm trying to organize this so that it remains practicable for the plan that I intend to have with it. An example showing what my f

Find sorting algorithm for an elevators floor travel schedule, starting from the current floor with preselected floors to reach and a travel direction

I'm making an elevator in react, But I need to make a function that sorts an array to the nearest to the number X and also there is a condition if the elevator

Is it possible to set breakpoint in devtools when cookie is set?

I'd like to set breakpoint when cookie is being set, either by HTTP response header Set-Cookie or by javascript document.cookie='cookie1=value1. I need this bec

Using Web Workers with React and Webpack 5

I have been trying to use Web Workers with react for a few days and I ran into a few issues. I started with a create-react-app using webpack 4. I could use a we

Javascript running locally but not on heroku node js

I have code which pulls a list of urls from a JSON file and then displays them. It is a node.js app. It works locally but then when I push to heroku it doesn't

Redux Toolkit doesn't work well with WebStorm

I'm learning Redux and Redux Toolkit, but I don't understand why autocomplete doesn't work when I'm trying to dispatch an action (see the image below). I import