2,527,149 questions
0
votes
0
answers
16
views
Custom error objects for Mongoose schema paths
Take the following Mongoose schema.
const userSchema = mongoose.Schema({
username: {
type: String,
required: true,
unique: true,
minLength: 3
},
name: ...
-1
votes
1
answer
28
views
Receiving object undefined on backend in socket.io
I am using ReactJS along with socket.io for building an application.
App.jsx
import { useState } from "react"
import io from "socket.io-client"
const socket = io.connect(...
-4
votes
0
answers
40
views
How do i know where to place an item [closed]
Hello im new to web development. Iam using this Jvascript to know where the location of the item i want to place is. Is this the good way or am i doing something wrong?
const header = document....
0
votes
0
answers
37
views
Scaling effect for images in CSS
I am trying to give all 4 images an animated scaling effect (enlarge or "blow up" effect). I am also using Elementor Pro - Ocean theme.
The first element is controlled by CSS to generate ...
-1
votes
0
answers
27
views
usestate dose'nt update immidiatly [closed]
I am trying to delete a block from a list of blocks and then update the list block ids using the index.
function handleKeyDown(e, id) {
if (e.code === 'Backspace') {
let blocksCopy = [...blocks];...
-3
votes
0
answers
39
views
Tailwind CSS padding and margin not working after adding to existing React project with manual CSS [closed]
I’m working on a React + Vite project where the existing styling is done using manual CSS files (many .css files in /src/styles).
Since maintaining many CSS files is becoming difficult as the app ...
0
votes
1
answer
28
views
Is it possible to short-hand forward child component exports in Svelte 5?
If I have a child component, for example Dialog.svelte, which exports some const values:
<script lang="ts">
// Just to illustrate that this is a Svelte 5 component
let { title }: { ...
0
votes
0
answers
8
views
React Native Project didn't connect to metro on IOS Physical device
I've successfully installed the application on my IOS device in which app is installed but didn't connect to metro but when I shake phone and open debug menu Connect to metro to debug JavaScript ...
0
votes
0
answers
20
views
Manifest v3 couldn't load the script file
I'm trying to inject my script into the sender tab but in service worker console there is an error:
Uncaught (in promise) Error: Could not load file: 'chrome-extension://...'.
But when I fetch() this ...
-3
votes
0
answers
42
views
How to debounce API calls in React function component using useEffect and useRef?" [closed]
I'm trying to debounce an API call triggered by user input (e.g., search box) in a React function component. I want to avoid making a request on every keystroke and only call the API after the user ...
-1
votes
1
answer
47
views
Why doesn’t the UI update after an async call completes?
I’m trying to show a loading indicator while an async request runs, but the UI doesn’t update until I manually interact with the page (like clicking a random element).
Console logs show that the ...
-4
votes
0
answers
33
views
Best practice for updating subscription status in Expo app with Razorpay (webhook delay issue) [closed]
I’m integrating Razorpay subscriptions in an Expo (React Native) app.
The issue is that Razorpay sends subscription updates via webhooks, but these can take up to a minute sometimes.
After the user ...
0
votes
0
answers
56
views
How to make part of a Zod schema optional only on submit?
I have a React project using TypeScript, React Hook Form, and Zod.
My Zod schema looks like this:
import { z } from 'zod';
export const loyaltyNmvFormSchema = z.object({
maxPoint: z.coerce.number()....
-3
votes
0
answers
49
views
Why is my event listener not working for dynamically created elements? [closed]
I have a list of elements that loads dynamically via AJAX. The event listeners don't work for the new elements:
// This doesn't work for new elements
document.querySelectorAll('.item').forEach(item =&...
0
votes
0
answers
28
views
Bootstrap 5 table not updating correctly when fetching new data from API (old rows remain or mix) [closed]
I’m building a Bootstrap 5 table that fetches data from a public API using fetch(). The first render works fine, but when I try to update the data (for example, by clicking a “Refresh” button), the ...