Category "javascript"

"Cross origin requests are only supported for HTTP." error when loading a local file

I'm trying to load a 3D model into Three.js with JSONLoader, and that 3D model is in the same directory as the entire website. I'm getting the "Cross origin re

Module not found: Error: Can't resolve 'crypto' and Cant resolve 'fs'

ive just started to learn react and Ive been trying to get my react app to connect to my database with var mysql = require('mysql'); var con = mysql.createConne

Webpage in the same row pictures

I want this photos in the same row what should i change ? I tried float left and other commands but one picture is staying in the lower right corner. <secti

How to extract data from mp3 in javascript to process it using a neural network and play it on speakers?

How to extract data from mp3 in javascript to process it using a neural network and play it on speakers? Are there any solutions?

Sorting a store (array of objects) is working differently on Firefox and Chrome and updating items don't seem to push a reordering properly

Context I'm using Svelte and SvelteKit in a project. I'm using a store to update other components/pages and get reactivity, and later I'll persist it on localSt

How to create a new object as a subset of object properties of any depth, while renaming properties on the fly

Although a plethora of posts have been dedicated to the topic, I still couldn't find a satisfying idea how to subset object properties of any depth. More so, I

How to get Max Date in an array?

I'm trying to get max day in an array of dates but it returns Invalid Date or null. Can't figure out what is wrong. Should I convert the values to another forma

Uncaught TypeError: Found non-callable @@iterator (react/typescript|esbuild-loader)

So i am trying to replace ts-loader with esbuild-loader in webpack, however it seems like as soon as I make the change, the page stops working. { test: /\.t

How can i global configuring aws amplify?

I have configuring of storage, but i have one problem with customPrefix. CustomPrefix using for Storage.get and Storage.put. How can i do customPrefix for only

How to animate visibility of mesh in react three fiber?

I have a 3D model. I have the access to the mesh. What I want is to animate the visibility on button click. When I press a button the mesh should be invisible b

My browser sends fetch data request continuously and it gives pending status after giving 200 several times in react

I'm trying post some data in mongodb database and it works perfectly until the fetch request is sending continuously even if I didn't do anything. In the networ

product validation failed: describtion: Path `describtion` is required., name: Path `name` is required

when open seed page i get "product validation failed: describtion: Path describtion is required., name: Path name is required." instead of "seed opened", how I

Discord.js Send a message every X seconds with Client.on('ready', () => { });

I would like to send a message every X seconds and that the user who reacts first gives him 10 coins. The problem does not come from the system of coins, it is

How do I start an animation for a certain time?

I have the main loop of the program looped using requestAnimationFrame As for example after the character crashed, disable the collision for him for 3 seconds a

reading pathname from undefined using react router dom 6.3.0

I am using react-router-dom 6.3.0. Below are my routes inside App component <BrowserRouter> <Routes> <Route path='/article/*' element={<

Is it possible to make await + setTimeout + for loop work together?

I use async and for loop to test for fetch issues that might be caused by network or other issues. but testing too often It generates a request error similar to

JavaScript - Character counter for multiple textareas

I have a form on my website with several different textareas. HTML/PHP foreach ($bla as $blabla) { .... other php-code (not relevant) .... echo '<textare

Dynamic redirects with Gatsby

Given a Gatsby application with dynamically generated product urls on build: /product/x/ /product/x/variant1/ /product/x/variant2/ /product/y/ /product/y/varian

How to let user choose from sample of images displayed on screen along with option to upload from device?

const [selectedFile, setSelectedFile] = useState(null); const [preview, setPreview] = useState(null); const [predictions, setPredictions] = useState([

How to import component as a button in Nextjs?

I have this component with an internal link which is used in multiple pages when I try to import it as a button in the Nextjs application I get this result, it