Category "javascript"

How to get the component type in <script setup>?

This code comes from the official documentation and does not use defineComponent() to declare components. I tried and failed, and webstorm failed. //App.vue <

Download PDF file form embed tag using Puppeteer

I am trying to download a pdf from a Website. The website is made with the framework ZK, and it reveals a dynamic URL to the PDF for a window of time when an id

Map Dissapearing After Calling JumpTo (MapboxGL + React)

I'm developing a website that takes in an address from a user and plots a list of nearby locations using MapBoxGL and React. When the user runs the search, an A

React navigation 5 really slow and dropping JS FPS on Expo

I am currently working on a React Native (Expo) App and I am facing some performance issues. I have not found any answer yet for my problem so I hope someone ca

webpack-dev-server app doesn't render my html instead I get Cannot GET /

I am trying to run my javascript app with webpack dev server and I don't get my index.html back, instead I get Cannot GET / with this error inside the console G

Why I got empty object on Angular route?

Why I got empty object from ActivatedRoute params and how to fix that? routeId$ = this.route.params.pipe( tap((params) => console.log(params)), // <

Jest test case for React hook component

When I write a react hook component which import '*.png' resource like this: import React, { useState, useEffect } from 'react'; import './topMenu.less'; im

text() method not available in Blob

I am doing some Integration tests with jest & nock to test Axios interceptors chaining. In one of them, I am expecting to receive a Blob instance and accord

Best practices for handling UIState in StimulusJS

Just starting off with StimulusJS and trying to follow best practices. As I come from VueJs/Nuxt, state management and communication between components is quite

Problem with SOGo theme background isn't getting applied to md-dialog and md-card

I made a theme for SOGo (https://github.com/inverse-inc/sogo/) everything works except md-dialog and md-card Does anyone know why the background color doesn't a

Problem: ParserError: Syntax Error at line: 1, column 32

I am new to programming and I am with this problem. When I put in the Terminal "npm run build" to create the compression of my project in React.js I have this e

Display different language text in <noscript> tag, depending on browser language

I'm new to HTML, and I want to display a message when JavaScript is disabled. So I put the message inside <noscript> tag, which works fine. <noscript&g

Mixed named and unnamed parameters in JavaScript?

For a function with an intuitive first argument (e.g. a find semantic) I'd like to provide a way to write a function call without argument names while more comp

context.putImageData() Not working in React

Im trying to create a drawing application in react, its working for the most part. But when i try add an undo button it doesnt work. I try make the undo button

How to write typescript interface for Window object ethereum that has a request method being called

I am running the following function import { ethers } from "ethers"; async function requestAccount() { await window.ethereum.request({ method: "eth_reques

What is the difference between Array.from(Object) and [...Object]? [duplicate]

There are these two ES6-methods of creating an array from an array-like or iterable object: Array.from(): let arr = Array.from(Object); Spre

How to display distance in AR.JS

https://m.youtube.com/watch?v=biCKHVefIe8 How to show distance in location based ar.js in JavaScript like this? I build a-image and I want to show something lik

Module "pretty-format" has no exported member 'CompareKeys'

import type { CompareKeys } from 'pretty-format'; ../node_modules/jest-matcher-utils/node_modules/jest-diff/build/types.d.ts:7:15 - error TS2305: Module '"prett

JS How can I increase the performance of this Max/Min coding challenge?

I'm trying to solve some 'hackerrank.com' coding challenges. I'm stuck on this one: You will be given an array of integers arr and a single integer k. You must

Prompt login via saved google account

I know how to integrate "Login via google account" in any website. But in some website like zomato always prompt "login via google" account while opening. It sh