Category "javascript"

Detect navigation abort/cancel in a guard

Currently it's expected that the navigation is confirmed, so both beforeEach and afterEach global guards are triggered. showSpinner and hideSpinner are supposed

Webpack 5: file-loader generates a copy of fonts with hash-name

I cant figure out whats going on here. I use the file-loader to load the fonts of my application: { test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,

Should I migrate to Manifest v3 because most of the features of my extension depends on persistent background

I have a chrome extension which uses WebSocket, webrtc, audio and HTTP connections heavily, also I am using react-redux in the background to keep a state of UI

Passing query params or body with NextJS + Auth0?

So, my knowledge of next and JS in general is extremely minimal as is my Auth0 knowledge. I was wondering if anyone could suggest how to pass query parameters o

Discord.JS fetchMessage()

I have a problem with my Discord.JS Bot, I wanna to edit a embed in a spefic guild and channel, but when I try to run the commands, it errors out with this /roo

Codility CyclicRotation Javascript Solution: Empty array returns an error

I am trying to solve this problem in codility. My solution passed all the tests except for one with empty array and rotation of 1 as arguments. I'm someway lost

Update Parent State from Child Component and send back response to child

I have two components, Component A - const handleLike(id) { ..... handle the logic for the button and setting the state } <ComponentB handleLike={handleLike

How to test if React component is returning null or its children using React Testing Library?

I have a React component that returns its children to be rendered by React if the prop isTrue is truth-y. If its prop isTrue is false-y, then the component retu

How to save current language (i18n) in localstorage (Vue)

I'm developing an app in Vue using Vue Routers and Vue $i18n plugin. This is my HTML: <div class="locale-changer"> <select v-model="this.$i18n.locale

Two empty strings are not equal in Javascript error

Before you dislike, leave a comment telling me why... One of these strings is imported using fs and the other is created through code. I noticed some weird char

Updating an intrinsic rotation with an extrinsic rotation

I am trying to model a Rubik's Cube for a personal project, using Zdog for lightweight 3d graphics. Zdog uses a {x,y,z} vector to represent rotation - I believe

Not able to submit the data to firebase from contact form

import React, { useState } from 'react' import styled from 'styled-components' import Title from '../Components/Title' import { InnerLay

Save Custom Data in Thingsboard ; Which is not a Telemetry data

I am using thingsboard. Lets say i have a simple User Form having the following attributes: Username First Name Last Name Email Address Phone Number Now i want

Regex splitting on newline outside of quotes

I want to split a stream of data on new lines that are NOT within double quotes. The stream contains rows of data, where each row is separated by a newline. How

How to properly apply ternary operator in v-model in vue.js?

I am trying to apply the ternary operator in the v-model but it's not working. I also read a lot of similar questions and answers on StackOverflow but none answ

Query and get data from an endpoint through the a search bar input in javascript

This endpoint http://vk-data:8003/v1/entity/ returns this: [ { "id": "country", "url": "http://vk-data:8003/v1/entity/country", "nam

react material table export button not view correct

[in my react use export button material table not show complete bar my code i use the source code in material table: options= {{exportButton:true }} how solvet

Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves

I am trying to write tests for electron using spectron. This is my code. describe ('Application launch', function(done) { this.timeout(30000); const app

How To Solve The React Hook Closure Issue?

import React, { useState} from "react"; import ReactDOM from "react-dom"; function App() { const [count, setCount] = useState(0); function handleAlertCli

How to use `firebase-admin` inside firebase functions using ES2015

Nothing I do here seems to work, I can't find an example anywhere that actually seems correct This: import { initializeApp } from 'firebase-admin/app'; Throws: