Category "typescript"

Angular - Cannot read properties of undefined (reading 'forEach') by trying to manipulate variable after an HTTP call

I'm trying to manipulate a variable after an HTTP call. I want to use functions such as .push() or .forEach(), but it doesn't allow me because data isn't assign

Make id in FormattedMessage from react-intl inherit from a custom TypeScript interface to enable VS IntelliSense and type checking

Given that react-localization does not have date and number format and is heavily dependent on one developer we decided to switch to react-intl because it seems

Typescript - Custom type assignment by value [duplicate]

In one of my procedures I need to periodically reset a custom type, but I noticed that in TypeScript (and I think in JavaScript too maybe), wh

Can I short-circuit type evaluation?

I'm trying to create a composable configuration framework wherein each node in the dependency graph can access all of its upstream nodes. Although I've managed

Angular typescript update class if element is in array

I am doing an APP in Angular 12. In my component.ts I have an string array[] like AccessRoles["AA","BB"] And on the other side I have a class like this export c

MaterialUI - 'StylesProvider' cannot be used as a JSX component

I have an app written in React with TypeScript and lately after refreshing node modules and the lockfile I am getting this error when trying to run the app: Typ

Ignoring axios error for invalid certificates when creating a vscode extension

I am currently working on a Visual Studio Code extension that makes HTTPS GET requests and I am trying to ignore invalid certificates e.g. expired certificates.

NestJS setup TypeOrm connection with .env and @nestjs/config

I'm trying to find the most legal way to set up NestJS database using .env file. That is I want to use @nestjs/config package for importing .env variables and u

How to remove HTML tag (not a specific tag ) with content from a string in javascript

Is there any way to strip HMTL tag with content in HTML example : const regexForStripHTML = /(<([^>]+)>)/gi const text = "OCEP <sup>&reg;&l

Why is Swiper not working for me in angular?

I am trying to use Swiper but I cannot achieve it, I followed the steps in the documentation (https://swiperjs.com/get-started/), the problem is that all the im

How to control address bar change and back and forth actions in browser?

Have a nice day, everyone! I have a problem. I have an application written in React/TypeScript using Redux and react router . There is a table in which the user

What I am doing wrong when testing this method?

I am trying to test a method within a service that performs an http post. I have mock the service in my spec.ts and all seems correct for me, but the boolean va

Types of property 'theme' are incompatible in cucumber-html-reporter

Hi I'm new to cucumber framework and I was trying to generate a html report using cucumber-html-reporter. But the 'theme' property in options of cucumber-html-r

Property 'authorization' does not exist on type 'Request'

Consider this code: setContext(async (req, { headers }) => { const token = await getToken(config.resources.gatewayApi.scopes) const completeHeader

How should I design with React/Typescript: Server sends list of steps. Each step has a type and payload

I'm looking for some good ideas on software design for this problem: A server sends an array of Steps: type StepTypeEnum = 'SECURITY' | 'PERSONAL_DETAILS' | ...

Typescript says NextJS environment variables are undefined

I'm trying to make social login using 'react-google-login'. .env in root NEXT_PUBLIC_GOOGLE_CLIENT_ID=askfjaskf Ready.tsx import { GoogleLogin } from "react-go

Data from function is of type unknown - functions v9

I have a cloud function that takes an email and returns the user info, including the uid. The function is declared like this: const getUserByEmail = httpsCallab

Firebase functions dispatch tasks in order

Based of this article recently published by Google I am trying to dispatch firebase tasks in the order(first in first out) of the queue. But no matter what sett

Is there anyway working with schemas in Deno?

I am trying to store and work with a similar to following structure data using Deno and MongoDB. [ { id: "AAPL", stockData: [

What is the "right" way to nest components?

This seems like a very basic questions, but neither the documentation nor code examples I found were able to tell me. Given the following example: import { Flow