Category "typescript"

express.json() is an unknown property

Typescript doesn't recognize the express.json() function although many tutorials state this code should compile as it is. Is there something I have done wrong?

Dealing With Assertions in Functional Code

While doing functional programming I often end up in situations where I know something that the type system of the language does not know. Consider the followin

Type 'Observable<ArrayBuffer>' is not assignable to type 'Observable<Date[]>'

consultar ( opcion: string, articulo: Articulo ): Observable<Date[]> { return this.http.get<Date[]>( this.rootUrl + "consultar?opcion=" + opci

Using ES Module packages in Azure Typescript Function

I am unable to use the package p-map in my Azure Function. I get the following error: Worker failed to load function: 'serverless' with function id: '<id>

Angular MIME issues in Edge

I'm running into an issue with Angular where if I ng serve and deploy on localhost, the page loads fine. However if I use ng build and deploy remotely, I then g

Angular Material table filtering out all results when input is initially blank, will work after typing into input Only

So my table works really well, except that it shows no data until either a row is clicked or the filter is used. I am unsure as to what is going on here, not su

Fastify Swagger, add tag and description to fastify route

I'm using fastify 3.28.0 (plus fastify-swagger plugin) with typescript 4.6.2, and I'd like to add tags, description and summary inside every route. From docs: f

getting response data on logger interceptor

I am trying to log the response data by using logger interceptor, but when I send a new request I get output before undefined after instead of what i expect to

Observe (get sized) control (listen to events) over a nested component in the react and typescript application via the forwardRef function

I have a functional component called MyDivBlock const MyDivBlock: FC<BoxProps> = ({ }) => { {getting data...} return ( <> <div clas

TS - NodeMailer OAuth2 'auth' does not exist in type 'TransportOptions

I have a problem. I need to make email sending function with Gmail api. In docs it tells me to make a createTransport function like this: const transport =

I want to be able to append the selected value from a mat-select to the text area below on click

I have been asked to do this project using Angular in work and honestly not touched Angular 2 before. I can do this no issue using jQuery but I am having troubl

Error: export 'control' (imported as 'L') was not found in '@raruto/leaflet-elevation' (module has no exports)

I have a angular application and need to use the custom leaflet package: https://github.com/Raruto/leaflet-elevation I am trying to use this in my application.

React Navigation V5 custom header + Typescript Error: custom property 'rightButtons' does not exist on type 'object' (router.params)

I create custom header: const header = ({ navigation, route, options, back }: NativeStackHeaderProps): React.ReactNode => { const buttons: HeaderRightBut

How to create type/interface from another type interface?

I have interface of values types: interface ValuesTypes { foo: string; bar: number; } and Union of Controls: type Controls = 'selectFoo' | 'tbxBar'; and m

Overload Signatures and the Implementation Signature in typescript

I am reading Typescript handbook and I am having a hard time to understand why the following code snippet have error message: function fn(x: string): void; func

next build command is not ignoring *.stories.tsx files [duplicate]

I am trying to build nextjs project which has [componentName].stories.tsx side by side with component itself. Running next build fails because

In Jest, how do I mock a Promise of void?

I'm using Jest and Typescript. I have a async function that returns nothing (void). How do I mock returning void? I tried the below const myMockFn = jest.fn(

onSubmit form send data to another component/route in React

I am currently having a react component, where I have a small form: const firstName = React.useRef(null); const handleSubmit = e => { const data = {

Attempting to add multiple items to SP list using sp/pnp but getting error on ```createBatch()```

I'm following this documentation: https://pnp.github.io/pnpjs/sp/items/#add-multiple-items But I'm getting an error with: import { SPFI, spfi, SPFx } from "@pnp

How to extend my type while I'm extending other type already?

export type InputProps<T extends FieldValues> = { control: Control<T, Record<string, unknown>>; name: Path<T>; placeholder?: strin