Category "typescript"

How to tell typescript, that process is not undefined?

In the following line of code: internalWhiteList = process.env.INTERNAL_IP_WHITELIST.split( ',' ) I get an error saying, Object is possibly undefined. env va

Is it possible to restrict TypeScript object to contain only properties defined by its class?

Here is my code async getAll(): Promise<GetAllUserData[]> { return await dbQuery(); // dbQuery returns User[] } class User { id: number; name

Local server won't start TS-Error Container TS2345 NodeJS?

I'm trying to run a test project on the server. Gives an error message ~/www/ork-wiki-admin-back-test $ npm run test-start > [email protected] test-

laravel Livewire wire:click not firing the function

I want to do a SPA with laravel livewire, i want to use wire:click to fire a funtion in the component but it not working , excuse me if the code mess its my fir

Angular version upgrade 8 to 9

I am updating my angular project version from 8 to 9, after resolving other build errors when i run ng serve my compilation is getting stuck at 15% building 43/

Why does the node inspector not start when I am using nodemon and ts-node?

I have a simple node server written in typescript. My package.json is configured as: "scripts": { "build": "tsc", "dev": "nodemon --watch src/**/* -e ts,js

Close menu on container scroll

I want to close the react-select menu when scrolling a container outside of the select control. There is a closeMenuOnScroll prop in the official react-select d

Cannot find module './styles.scss' or its corresponding type declarations

i install yarn create react-app my-app --template typescript yarn add sass App.tsx import styles from "./styles.scss"; function App() { return <div classN

I want to use superagent in TypeScript-ed React

I want to use superagent in TypeScript-ed React. I try to write Tutorial with TypeScript and try to use superagent when reqest server. And I faced errors to use

NPM package cannot be used as a JSX Component - Type errors

Ive been getting these strange type errors on my typescript project for certain packages. Ex: 'TimeAgo' cannot be used as a JSX component. Its instance type '

React 18 TypeScript children FC

I upgraded to React 18 and things compiled fine. Today it seems every single component that uses children is throwing an error. Property 'children' does not exi

SAM local start-api CORS issue

I am using AWS CDK (Typescript) and running SAM local start-api to spin up an API tied to lambda resolvers and am running into a CORS issue when trying to hit t

Jest beforeAll vs beforeEach unexpected behaviour

I have a quite simple test, basically I'm trying to mock i18next's t function: import { t } from 'i18next'; import { changeDocumentTitle } from './utils'; jest

target in tsconfig.json setting not working but command works?

{ "compilerOptions": { "target": "es5" } } I have tsconfig.json as above, and when I run command tsc app.ts --watch, I hit error Accessors are only av

Yup / Formik validation using dynamic keys

I am trying to validate a form with a dynamic amount of fields - i.e., data is returned from an API that determines how many rows are shown, and for each row th

react-dom installed, but not found. `Could not find module in path: 'react-dom/client' relative to`

Here is the Codesandbox I want to run a rest, but the Tests tab shows this error. Could not find module in path: 'react-dom/client' relative to '/node_modules/@

How to use Promise.all() with Typescript

Here is what I want to do: Promise.all([aurelia.start(), entityManagerProvider.initialize()]) .then((results:Array<any>) => { let aurelia:

Attempted import error: 'Wallet' is not exported from '@project-serum/anchor'

Trying to import the Wallet class but getting error in title at runtime. This issue apparently should have been fixed in v0.21+ but it doesn't appear to work in

I can't get "Typechain" folder when I install dependencies using hardhat

When I install all the dependencies but didn't get the "typechain" folder in the typescript hardhat. how to get it? npm init npm install --save-dev hardhat npx

Angular Material 2 table server-side pagination

I am trying to Achieve Angular Material 2, MatPaginator server side paging. How can I achieve that? Below is the code example: <div class="example-contai