Category "typescript"

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

enforce property order in a typescript interface

I am building a typescript interface to an API that I do not control. The API is xml based and expects properties in a particular order. These properties are no

Compile tailwindcss + typescript

I have a very simple app with some html, css, and ts files. I use swc to compile the typescript and copy over the html/css/assets. Now, I'm looking to add tailw

How to make one object type which will contain properties of all objects of union type, but values will are intersections

How can I make a type which will make a one object type from unions of objects, which will contain properties of all objects of union type, but values will inte

TypeScript error in directory/node_modules/@antv/g6-core/lib/types/index.d.ts(24,37): Type expected. TS1110

After cloning the repo from GitHub and installing packages by running yarn install, when I'm run the project getting this error. I tried to update react script

How to Compress JSON data in angular 4 app using gzip compression & send it to server using Http post?

I am using pako library for compression: var binaryString = pako.gzip(data); At server side (.net core) i am using middleware to decomopress the zipped stri

Check if a component is an instance of React.ReactElement<any> in a child map

I have a component that loops through children and wraps them in a div. I am trying to add an exclusion to that, but running into an issue where I can't check i

Why ngOnChanges() does not trigger when @Input() update the data Angular 8?

parent.component.html <parent-comp [data]="mydata"> </parent-comp> parent.component.ts this.service.abc$ .takeUntil(this.ngUnsubscribe.asOb

Using a function on stylesheet typescript react native

I try to use some variables inside my StyleSheet file. The UI is working fine. But the type is error. Any idea how to solve this? type buttonStyle = (height: nu

Vue 3 refs is undefined in render function

I have a simple Vue component with root element as ref="divRef". However, in onMounted function, divRef.value returns undefined. Any help will be appreciated. i