Category "typescript"

Failing tests -> Cannot read properties of undefined (reading 'rpc')

I was writing a test in TypeScript for Adding two numbers. I am receiving the following error: Adds two numbers: TypeError: Cannot read properties of undef

type 'never[]' is missing the following properties from type 'Observable<Customer[]>'

I want to fetch customers list from my back-end via get Http call. But i am unable to declare array of customers in my component. I have customer.interface.ts l

Files With A Tag in ObsidianMD

I'm trying to write a plugin that fetches the list of files containing a particular tag (like "#condition") in ObsidianMD for some downstream purposes. The buil

TypeError: Unknown file extension ".ts" in a Solana Anchor project

I got this error after updating Solana-cli to 1.9.4 and Anchor-cli to 0.20.1 and other local npm versions... Local npm package: @project-serum/anchor 0.18.2 Sol

How to use Google Identity Services JavaScript SDK with Vue / TypeScript?

I'm trying to authorize some Google APIs using the new Google Identity Services JavaScript SDK in my Vue / Quasar / TypeScript app. As per the docs I have loade

Create Infinite Scroll with react typescript

How do I create a infinite scroll that detects when we reach the bottom of the page but with typescript

Error loading workspace IDL for Solana Anchor Testing

For some reason, my mocha test is unable to find my IDL. I am getting the error below: name@Mabels-MacBook-Pro solana-anchor-reactjs-payment % anchor test BPF S

NestJS/TypeORM: Cannot set property metadata of #<Repository> which has only a getter

I try to run my nestjstutorial app, the below error is showing. My backend is connected to a PostgreSQL db. TypeError: Cannot set property metadata of # which

Error loading workspace IDL for Solana Anchor Testing

For some reason, my mocha test is unable to find my IDL. I am getting the error below: name@Mabels-MacBook-Pro solana-anchor-reactjs-payment % anchor test BPF S

Path variable to use in data in Angular

i have a problem with tab title setting. Before is was always the same title which is set in index.html Now i would like to have another title in some component

Typescript const enum alternative

More and more modern Typescript transpilers have moved toward a strategy of per-module transpilation, which significantly increases build speed, but eliminates

TS2322: Type 'Count' is not assignable to type 'ReactNode'

I am new in react and TS and I need help I am trying to use useState with typescript import React,{useState} from 'react' interface Count{ count: number } co

Cannot find module '@babel/runtime/helpers/interopRequireDefault' from 'node_modules/react-native/jest/setup.js' when I run tests

I'm trying to build a mobile application with typescript, react-native, expo and jest. When I'm trying to run tests: FAIL src/components/Button/tests/Button.t

How do I import an ES6 JavaScript module in my VS Code extension written in TypeScript?

I am developing a VS Code extension in TypeScript and I am trying to import a JavaScript library from npm that is packaged with "type": "module", in its package

MethodOf type cannot be used to call the method

I would like to dynamically generate some tests, for that I have to call a method with the method name to be called and then all the test setup is done and the

TSyringe: How to change a parameter of an injected object?

I have an app with multiple different components, each component having their own dependency and am using TSyringe to manage dependency injection. One of the co

using Moment with Angular library 13 causes an error

When i use the moment.js (latest version) in an angular library, i am facing the following problem: vendor.js:sourcemap:106713 ERROR TypeError: (moment__WEBPACK

Module not found: Error: Can't resolve the typescript file when adding typescript to a CRA app

I'm trying to add typescript to my project and write new components with typescript. I followed the documentation but I'm got this error:can't resolve [the type

How to resolve the error: Module '"react-hook-form"' has no exported member 'useForm'

I want to make simple login page using react-hook-form I get this error: Module '"react-hook-form"' has no exported member 'useForm' import React from 'react'

Why am I getting "Type instantiation is excessively deep and possibly infinite"?

Playground link I have these general definitions: type Module<P extends Payloads, C extends Children> = { payloads: P; children: C; }; type Child