Category "typescript"

Standard way to add custom react-scripts in create-react-app

I have a project created from create-react-app and is in typescript, I want to add suport for custom react-scripts without eject so what would be the best way t

Getting error: The expression is not callable Mongoose NextJS

I trying to save data to a mongoose model on NextJS page. I get a typescript error on this line: await User.create(data) This expression is not callable. Each

Why are the args for my storybook component showing as optional instead of required?

I have a simple loader component import React from "react"; import { Backdrop, CircularProgress } from "@material-ui/core"; import { makeStyles } from "@mat

Property '$vuetify' does not exist on type - when using Nuxt.js with Vuetify

I have this error for a particular part in the code when accessing this.$vuetify in my Nuxt.js app. ERROR ERROR in components/equipment/QuickInfoCard.vue:21:

Property '$vuetify' does not exist on type - when using Nuxt.js with Vuetify

I have this error for a particular part in the code when accessing this.$vuetify in my Nuxt.js app. ERROR ERROR in components/equipment/QuickInfoCard.vue:21:

Importing JSON as a type

How do I define the type for imported json? For example { "things": "foo" } interface Data { things: String, another?: String } import data from './data

Angular testing async function generate error - 1 periodic timer(s) still in the queue

I'm trying to test that two async functions. The problem is that one of the functions is called every 10 seconds automatically. I tried to use tick() or flush()

Module parse failed: The keyword 'interface' is reserved (5:0) File was processed with these loaders

It is my first time publishing package to NPM. I have published simple React + TypeScript component to NPM, but when I installed and tested it, I am getting the

Typescript Compiler API:How to get absolute path to source file of import module using typescript compiler api

I try to get the path information as follows: const typeChecker = program.getTypeChecker(); const importFileSymbol = typeChecker.getSymbolAtLocation(

Typescript Compiler API:How to get absolute path to source file of import module using typescript compiler api

I try to get the path information as follows: const typeChecker = program.getTypeChecker(); const importFileSymbol = typeChecker.getSymbolAtLocation(

node_modules/@types/chrome/index.d.ts is not a module

I've nx monorepo having React TypeScript app. When I'm trying to use chrome in any of .ts file, VSCode is reporting a error saying Cannot find name 'chrome'. I'

convert object in to array of json with given keys [closed]

I have object like { labels: ["city A", "city B"], data: ["Abc", "Bcd"] }; I want to convert above object as below array of json [ { labels

How to map with the help of Automapper (TypeScript) the entries of an array filled with different DTOs?

I'm using the TypeScript library "Automapper" in my NestJS backend to convert an answer of MongoDb/Mongoose to an DTO. That's how the answer looks like: { "

React - Property 'data' does not exist on type 'IntrinsicAttributes & InfoGridProps'

I have a demo here I'm just trying to create a simple app where I pass data to a component and then display that data So I have the data which is an array of ob

How do I delete all unused imports in the active file with one command in VS Code (typescript)?

Previously, I used to be able to do CMD+SHIFT+p > Organize imports and this would both sort and delete unused imports. This functionality seems to have broke

Supplied parameters do not match any signature of call target - angular 4

I'm using ngx-translate in service. Exactly in this function. @Injectable() export class StartService { constructor(private translateService: Trans

Svelte - routing , When I try entering any url I only get "No webpage was found" error

Using "svelte-routing" because I need to load a single page from lots of different urls , with the different urls serving as parameters. For example if a client

React Typescript: Type issue when passing multiple refs to child component

I have a main component that passes down multiple refs to Panels component like so import { useRef } from 'react'; import Panels from './Panels'; export const

Storybook-tailwind. How should I add tailwind to storybook

I want to add tailwind to storybook. So that Stories will render just like it will render on web. I used create-react-app project-name --template typescript to

How to use mocks in tests with Adonis 5 (adonisjs/fold package)?

I have an API built with Adonis 5 (core version 5.4.0). The tests are made with Adonis' own runner, japa (version 3.1.1). As per the Adonis documentation, I bui