Category "typescript"

HTMLElementWrapper solution for extending prototype -- adding new functions

The problem is quite simple: add two functions to the HTMLElement which is on and off. The on functions works exact same as addEventListener The off functions w

"Workerpool Worker terminated Unexpectedly" for Mocha tests in CircleCI

I have TypeScript tests running with Yarn and Mocha and they work fine locally. When I deploy via CircleCI, however, I get this: 1) Uncaught error outside test

TS2322: Type 'typeof StatusEnum' is not assignable to type 'StatusEnum'

Method: get statusEnum(): StatusEnum { return StatusEnum; } Enum: export enum StatusEnum { Open = 0, Edit = 1 } error: TS2322: Type 'typeof S

Resolving multiple versions of React in component library built with Webpack and Storybook

I'm trying to build a React component library built on top of MUI and using Storybook and TypeScript. Because Storybook (which uses create-react-app) is based o

Resolving multiple versions of React in component library built with Webpack and Storybook

I'm trying to build a React component library built on top of MUI and using Storybook and TypeScript. Because Storybook (which uses create-react-app) is based o

how to send jwt token correctly

In my angular application I am trying to send a jwt token as a header in order to authorize my app for requests. But I am getting an error 500 because I am send

Unable to find svgs assets with Parcel in React and TS

I've added parcel to a create-react-app project that uses the typescript template. I'm trying to add svgs to my outputted js file following the recommendations

Is there a way to make VSCode show errors for unresolved types in .d.ts files?

I love working with TypeScript in VSCode and seeing all the errors automatically pop up with red underlining. I even set "typescript.tsserver.experimental.enabl

Cannot find module 'faker' or its corresponding type declarations.(2307)

I was trying to use 'faker' with TypeScript in TestCafe Studio. But I'm getting an error saying Cannot find module 'faker' or its corresponding type declaration

Vue3 Typescript error on registering component inside another

I have a Vue3 component (using TS) in which I'm trying to render another component inside it like this: TopBar.vue <template> <TopBarProfileDropdown /&

What is this StencilJs Syntax?

render() { return ( <Host> <div> I don't understand this syntax. Stencil is written in typescript file. As a a parameter return

'TypeError: Cannot set properties of undefined (setting '0')'----Array assignment

When I was solving a problem on Leetcode, I've defined an empty array. I tried push some numbers then I got this Error. I don't know why. My code here.

How can I have multiple DTO's for NestJS Request Body/Swagger

so I have a route that can accept two different DTO's. I'm having difficulty getting these two DTO's to link/show up on swagger. I'm using the swagger plugin wi

Proper way to export dynamic module

I have a NestJS application with the CoreModule which exports an collection of the core services to all other modules. In core module i have dynamic module regi

Property 'isOpen' does not exist on type 'IntrinsicAttributes. ts(2322)

I'm creating a navbar, but I'm not able to show the Wrapper menu when clicked. The error occurs when inserting isOpen = {isOpen} in <Sidebar /> ERROR Typ

ndarray type annotation typescript

I created a function that creates an array from a given shape with typescript. But how do I specify the return type of that function as it will vary depending o

Error on building app using Ngx-extended-pdf-viewer

Just started angular and I am trying to use a PDF Viewer integrated into my application. I saw ngx-extended-pdf-viewer while browsing which library to use and t

Visual Studio typescript errors but webpack builds fine and no red squiggles in editor

I'm getting many of the following errors when in the Visual Studio (not VS Code) Error list: Cannot find module '../../dataStructures'. Did you mean to set the

how to create register mutation Graphql typescript

import { Arg, Field, ID, InputType, Mutation, ObjectType, Query, Resolver } from "type-graphql"; import { PrismaClient } from '@prisma/client' const prisma = ne

Create union literal type from key values

The TableData type has the same properties as the return type of the following function const createTableData = (cod: string, promo: string, type: string) =>