Category "typescript"

What is the type of the webpack config function when it comes to TypeScript?

I cannot figure out the type of the webpack configuring function when the config is written in TypeScript. Currently I export an object whose type is Configurat

Typescript error (2345) when pushing element to array of elements(React js)

I'm pretty new to Typescript and I was trying to migrate a component I had on Reactjs to typescript. This component is supposed to receive a number from 0-10 as

Typedoc / Typescript Compiler throws error on an imported type

Summary I am attempting to build documentation for a TypeScript project using Typedoc. Unfortunately, Typedoc is yielding errors on an import statement I use in

ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'

Could you help me, I've got this error when I try building a project? Oops! Something went wrong! :( ESLint: 8.0.0 TypeError: Failed to load plugin '@types

Synchronously iterate through firestore collection

I have a firebase callable function that does some batch processing on documents in a collection. The steps are Copy document to a separate collection, arch

Could not find a declaration file for module 'vue-xxx'

Any 3rd party Vue.js library that I try to add to my project, throws the following error: Could not find a declaration file for module 'vue-xxx' I have tried

React: How to solve 'Spread types may only be created from object'?

I am trying to create a handler method in React, but I'm getting a typescript error with spread operator. Could someone help with this error please? I did follo

Angular 5 - Copy to clipboard

I am trying to implement an icon that when clicked will save a variable to the user's clipboard. I have currently tried several libraries and none of them have

How to include a global file type declaration in a TypeScript (Node.js) package

I'm working on a package that I am planning to publish publicly on npmjs. Let's call it the "text package". I would like that by default when installing that pa

How to build a TypeScript class constructor with object defining class fields?

In TypeScript it's possible to create a class with a constructor that takes parameter with access modifiers and it automatically convert those parameters in cla

Why are logical assignment (&=) operators disallowed in Typescript?

With the following code: var x:boolean = true; x &= false; Results in error TS2447: The '&=' operator is not allowed for boolean types. Consider usi

Object is possibly 'null' (undefined)

See, this is my code and it is saying few errors, which are: Object is possibly 'null', Property 'style' does not exist on type 'Element'. It is very irritating

NestJS and Serverless - handler 'handler' is not a function

I am trying to implement NestJS as a AWS Serverless function using serverless-framework. I was following this official documentation and my code is exactly as i

Resolve Error: typescript with invalid interface loaded as resolver ESLint

I'm having ESLint in my project and getting an error Resolve Error: typescript with invalid interface loaded as resolver : import-no-restricted-paths when I ad

How do I compile Typescript at Heroku postinstall?

Instead of uploading the precompiled dist directory, I want to compile src at server side instead. Here are my scripts inside package.json: "scripts": { "

How to fix NextJS webpack error: You may need an appropriate loader to handle this file type, currently no loaders are configured

I generated NextJS project using TypeScript template and I want to add my Storybook to the project. Storybook is written in TypeScript. When I'm adding Storyboo

Typescript: add instance of external dependency to window object

I am integrating an external dependency into an Enterprise project. The integration goes like this: window.foo = new Foo({ container: `#${iframeContainer

How to break/continue across nested for each loops in TypeScript

I tried to use break inside nested for each loop and it says jump target cannot cross function boundary. please let me know how can i break nested for each loop

ERROR TypeError: Cannot read property 'slice' of undefined---Typescript

how are you? I have one problem 'slice' of undefined in my project. I use autocomplete material https://material.angular.io/components/autocomplete/examples M

Is there anyway to get types interfaces for request, response in Nest.js with Fastify

I am learing Nest.js and on the beging of documentation I read that I can use it not only with express but also with fastify so I setuped up my first project wi