Category "javascript"

How to get VUEX's value

vuex store/modules/cafes.js import CafeAPI from "../../apis/cafe.js"; export const cafes = { //status = 0 -> 数据尚未加ů

How can I solve a "MongoError: E11000 duplicate key error collection" error in Mongo?

I have created a new Mongo collection to a new project, but when I try to create a new user, I get the following error: MongoError: E11000 duplicate key error c

getting error "TypeError: Cannot read properties of null (reading 'useState')" on useState usage react

So I'm trying to use useState in my nextjs app, but as soon as I add in the line of code to initialize useState it throws a popup error with the error message:

Transition on light/dark mode

I did the code for dark/light mode this way, using Javascript and CSS. but I can't find anywhere a way to add a transition on changing the light/dark modes. CSS

Unable to resolve npm install pre-gyp error

I am trying to install this app locally on my m1 MacBook air > Github - Todoist Clone Running npm install in the terminal is causing the following error, ple

(Firebase Firestore)TypeError: n.indexOf is not a function

I'm trying to add another field value in a document but firebase returns TypeError: n.indexOf is not a function. Here's the code: async function linkLCSN(cor, s

Use 2D Colormaps Javascript Plugin in React

I'm new to JavaScript and for an assignment I need to use 2D Colormaps Javascript Plugin (https://dominikjaeckle.com/projects/color2d/) for visualization. I kno

How to make React search component

I am doing my first Ecommerce MERN stack project but i donot know how to make search component that will take the search input and return array of matching prod

How to show input field in only Uppercase using Oracle Jet oj-input-text?

I want to show letters only in uppercase in input text field. <oj-input-text style="text-transform: uppercase;" id="text-input" placeholder="Select new Item

Getting a Vue Error: Cannot find module for image for dynamic image

I looked at Vue cannot find module image location and couldn't figure out a solution. in my code when I hard code it :src="require('@/assets/featured/pizzaOne.j

React get value of object from localstorge

I get data from localstorage. I used useEffect. But when I want to get a value in object, I got problem. const [carinfo, setCarInfo] = useState(); useEffect((

Calculating part of area inside zone. Fabric.js/Canvas

I have an area (in this case, the Kitchen area with yellow borders), inside this area there are other shapes (numbered 1 and 2 light blue color) that divide the

Error in getting table row value to be deleted/updated. String input as undefined

I am making a simple CRUD function for a bill management system. It uses Jquery AJAX JSON to communicate to the servlets. The update and delete functions are ac

How to display data from client service in ngx-wheel Angular

I want to display the ngx-wheel using api but I'm having trouble displaying the data. Here my Service : import { Injectable } from '@angular/core'; import { Htt

MediaSource never emit sourceopen event in React

I'm trying to stream a video file using Javascript's MediaSource API in a React custom hook. Here's the snippet of my code: const useMyHook = (videoRef: React.M

Angular 8 ERROR Error: Unable to find context associated with [object HTMLDivElement]

Just another day in the office, right? What once worked is no longer working. Yay! I am supporting an Angular 8 web application and attempting to kickstart loca

useQueries how to get response for a certain query

Is it possible to distinguish the response, we get from useQueries. For example const ids = ['dg1', 'pt3', 'bn5']; const data = useQueries( ids.map(id => (

ln-service (npm-package) [ 400, 'ExpectedLndToCreateNewInvoice' ]

I'm using ln-service package and I'm connected to a local instance of lnd node (created with polar). I'm using plain js. import lnservice from 'ln-service'; l

Failing tests -> Cannot read properties of undefined (reading 'rpc')

I was writing a test in TypeScript for Adding two numbers. I am receiving the following error: Adds two numbers: TypeError: Cannot read properties of undef

Why .getMinutes() output as :0 instead of :00 in JavaScript?

The .getMinutes() method only outputs one integer ‘0’ instead of two integers ‘00’. Why does it do this and is there a simpler way to fi