Category "typescript"

Is there any way to better visualise typescript errors?

I am using babel typescript preset to transpile my code. Some TS errors that I am getting emitted in the console could use some better formatting. I wonder if t

Construct signatures with JSDoc and TS-Pragma ts(2351)

I've a function that returns a constructor dynamically. When I try to instantiate the new object it warns me This expression is not constructable. Type 'myConst

Next auth getSession with typescript

I am using next-auth getSession in API routes like this const mySession = await getSession({ req }); I am certain that the type of the mySession is this type S

Angular Material Datepicker Selection Strategy - how to get value of selected date range

I'm trying to create a table which will display some info. The columns will be dynamically changing according to the selected date range. I'm using Date range p

TypeError: Class extends value undefined is not a constructor or null while using stream-browserify

While using stream-browserify to import Transform class and extend it in the code causing the following exception in the browser console AudioUtils.ts:52 Uncaug

How can I bind my selectAll button in Angular to an $event change?

May I know how to trigger the $event on the click of my selectAll button in Angular? My code are as follows: <div class = "col-md-auto" id = "container">

TypeScript & React: What's the difference between 'React.HTMLProps<T>' and 'JSX.IntrinsicElements["T"]'

I am looking for the most "canonical" and/or "up-to-date" way to add a set of default HTML attributes as a set of allowed TypeScript props to a customized, "enh

Using Auth0 with NestJS on gRPC Methods

I am trying to implement NestJS Guards for Authentication and Authorization to my gRPC Services, which are implemented in NestJS. @GrpcMethod(USER_SERVICE_NAME,

Create extra boolean property with name suffix `_ro`

Can I create an extra property with a property decorator? The way I'm trying to do this obviously does not work. const RoProp = () => { return <T>(ta

Chosen label is not changing after cancel button in ng2-daterangepicker

Using n2-daterangepicker. Facing two problems. When select custom range its not changing the chosen label change If applied cancel button and then click custom

How to use vuex mutation in Nuxt

I am not able to use this mutation to change the state of a value in Vuex pages/example.vue <template> <div class="pa-md-10 mx-md-10"> <v-r

React pass multiple properties and children

I'm new to React, typescript and nextjs and I'm trying to pass multiple properties to a component. But, I seem to override them. For example I have this in my _

Keyof not working in template literals due to Symbols

I would expect either of these types to work, but these both throw errors. export type Object1<T extends { [k: string]: any }> = `${keyof T}`; export type

Assign value only when key is a valid property of a type in TypeScript [duplicate]

I have a type, e.g.: type Output = { fieldA?: string; fieldB?: string; } And I have an object, e.g.: const input = { fieldA: "A", fie

Typescript reduce return wrong Type and also forbid to assert it

Faced very strange ts behaviour. type Labels = Record<string, boolean | undefined> type LabelGroups = Record<string, Labels> export function reduc

FieldRenderProps with React Native TextInput

I created custom TextInput for final-form in React-Native. And I need to specify type for FieldRenderProps. And I have an error: TS2769: No overload matches thi

I get a problem with use dotenv with react in typescript or .tsx files

I tried to use import * as dotenv from 'dotenv' and import { config } from 'dotenv' and restart the server many tames else I tried that dotenv.config({ path: __

typescript + eslint + babel issue in expo project: lots of Parsing errors

eslint is giving me a really hard time > Parsing error: The keyword 'const' is reserved. :eslint > Parsing error: The keyword 'import' is reserved. :esli

Unable to create @manyToMany realtion ship in mikro-orm

I have issue with my @manyToMany relationship in mikro-orm framework. I created this entity: enum NotificationCategory { REPORT = "report", PARKING = "p

Typescript check that all env variables are set based on interface (union type to tuple type issue)

I want env.d.ts file to represent required application env variables and make sure that any change or addition to it will result in typescript error as well as