Category "typescript"

missing credentials in NestJs Passport

I've built an NestJS API with authentification. I'm using NestJS passport and I create a JSON web token when a user logs in. I've done numerous searches and I r

What is the correct typescript type for react children?

I'm trying to properly type the props for a component that maps children: type Props = { children: any } const MyComponent: FunctionComponent<Props>

`Property 'ethereum' does not exist on type 'Window & typeof globalThis'` error in React

I am getting the Property 'ethereum' does not exist on type 'Window & typeof globalThis' error in React. This is the line generating the issue: import { eth

CDK deploy results in "Bucket named 'x' exists, but not in account 067685711111. Wrong account?"

I am modifying a CDK pipeline that works. I am adding a lambda, and when this code modification is made, the pipeline fails with an error. import * as cdk from

Difference between Web Streams and Node.js Stream APIs

I'm building a file upload application to familiarize myself with the concept of streams. I'm trying to turn a file list or blobs into a stream then upload it t

Ant design onFinish function with typescript; Type '(values: FormData) => void' is not assignable to type '(values: unknown) => void'

I have interface FormData, which is supposed to be same type as values that onFinish function receives, but when I put const onFinish = (values: FormData) =>

Typed Indexing variable is not of the same type as the object being indexed

I have a slightly complex object that has typed keys on the top-most level of the object, as well as the deepest level of the object, and I can't seem to be abl

Material table cells with specific width according to predefined length

I will show my code first. <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef> No. </th> <td mat-cell *matC

Is getting Ansible to work with Pulumi possible?

I wish to create several droplets (DigitalOcean) in a loop and then run Ansible afterwards on the droplets to setup the required software and security measures.

Why does mat-tree toggle throws error when used to create story file?

I have created a tree component using mat-tree in a storybook module, and when I use it inside a component it works just fine. The problem is when I use it to c

How to make data() key function to work with TypeScript?

I am trying to use a custom key function for .data() with .selectAll() selection in D3. But, making it TypeScript compatible is becoming such a pain. The eleme

How to cache yarn packages in GitHub Actions

I am using GitHub Actions to build my TypeScript project. Everytime I run action I am waiting 3 minutes for all dependencies to get installed. Is there way to

'TypeError: Converting circular structure to JSON' in a Lerna workspace with CRA and Typescript

I have a Lerna Workspace with some packages and a webapp created with create-react-app using TypeScript. When I try to add node-sass (needed for customizing ag-

Create a global function like jest does

I am working on a meta framework that will use react. I would like to offer some functions that are directly available without the need of an import, exactly li

How to order an array of object during a forEach()?

So, basically I have this array of objects and I need to order them dependently on the value caricoData, which is a date. Problem is, the value is a string and

Enforce Typescript object has exactly one key from a set

Basic Question and Context I'm trying to type an array of objects where each object has exactly one key from a set. For example: const foo = [ { a: 'foo' },

Angular: Dynamically find headers when converting JSON array to HTML table

In Angular, I want to convert a JSON array to an HTML table. I have seen an old answer for AngularJS: <table> <thead> <tr> &

How to find the length of data source using typescript in angular application

Unable to find length of data source(array) using typescript in angular application this.activatedRoute.data.subscribe( (res) => { console.log(re

Routing in Aurelia2

After I click Save Device, I want it to return to my default route where is list with all my devices, it adds a new Device but it show error on : "this.router.l

Is there a way to combine ES6 imports and commonJS require in TS compiled files?

I have changed the code of a project made in NodeJS to Typescript. Everything is working fine, except for the fact that apparently a third-part package (file-ty