Category "typescript"

Angular serve library

In latest versions of Angular cli, we can use ng g library lib-name command to create library. As mentioned in the Angular docs : ng serve <project> An

'X Is not a function' in CommonJS

I've got the following code I transformed from a Trypescript, ESM-syntax based file to a Javascript, CJS-syntax file. const apiClientFactory = require("@vue-sto

How can I fix scoring for multiple-answer questions in my Angular quiz app?

For the multiple-answer questions, ALL of the correct answers should be selected in order for the score to increase, not just one correct answer. If one correct

How to create a string array in the useState hook and update that same array in TypeScript?

I have a React project where I am trying to create a multi select function where you can select and deselect multiple avatars at once. So far I have this: expor

React(Typescript) onchange event type

In My React Component I have Radio input <input type="radio" onChange={changeData}> and function changeData(e: any) {} How can I speci

TypeScript index signature with promises

What is the correct index signature for the following class? class MyClass { [index: string]: Promise<void> | Promise<MyType>; // not working p

Jest did not exit one second after the test run has completed using express

I'm using JEST for unit testing my express routes. While running the yarn test all my test case are getting passed, but I'm getting an error Jest did not exi

Imports not importing using Jest and Typescript

I am using Jest, Enzyme and Typescript, but for some reason certain imports are not working... they are undefined. For example, I have import ReactMarkdown from

How to toggle boolean state in React and TypeScript?

I am new to React and TypeScript. I want to toggle a boolean state (true/false) with a handler function. I've read other posts about how to do this in ES6 but

Why typescript keep giving me No inputs were found in config file error?

Why typescript keep giving me No inputs were found in config file error? When I use tsconfig.json in vscode, but when I try to build it, it gives me a 'No input

Get value from radio button Angular Material Dialog

I have Angular Material dialog , where I updating table clicking change status. I need to get value from radio button in my dialog Here is full working exampl

CQRS and cross cutting concerns like ABAC for authorization reasons

Let's assume a monolithic web service. The architectural design is based on the DDD and divides the domain into sub-domains. These are structured according to t

Getting error exponentiation operator for BigInt

When i am trying to do (BigInt(Generator) ** this.privateKey) % BigInt(Prime) i am getting error: Exponentiation cannot be performed on 'bigint' values unless

Absolute path not working in Vite project React TS

I'm struggling to get absolute path to work in a Vite react-ts project. Here's how I created the project npm init @vitejs/app npx: installed 6 in 1.883s √

gtag function Typescript definition

I use original Javascript function function gtag(){dataLayer.push(arguments);} then got error: error TS2554: Expected 0 arguments, but got 3. when used like

TypeScript and React - children type?

I have a very simple functional component as follows: import * as React from 'react'; export interface AuxProps { children: React.ReactNode } const a

Ionic invalid package name __ngcc_entry_points__.json

I'm almost finished developing my application with ionic and angular. Unfortunately, I'm totally stuck. I can't build my application (on android) anymore. Here'

This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag

I'm trying to make a simple API using typescript and NodeJS but when I run my code I get this error "This module is declared with using 'export =', and can

Can't run my Node.js Typescript project TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/src/App.ts

When I try to start my app on Heroku I got the following stack trace. It is just a basic ts.app like you see with ts-node and nodemon. I am really interested in

Cloudlinux NodeJS demands to store node modules for application in separate folder (virtual environment) pointed by symlink called "node_modules"

I was looking to deploy my Nodejs/TypeScript web application to my cpanel shared hosting. But, I am getting an error: * Cloudlinux NodeJS Selector demands to s