typescript Questions

2

Basically all my DTOs are generated with nullable fields like: id?: number;. How can I create non-nullable types for types which are not flagged as nullable. My DTO schema looks like this: "U...
Disk asked 8/10, 2020 at 12:22

3

Solved

trying to use "@material-tailwind/react": "^2.1.9" in "next": "14.1.4" "use client"; import { Button } from "@material-tailwind/react"; ...
Smorgasbord asked 9/4 at 7:50

1

I am building an NPM module to import into my projects. For testing, I am using npm link to link to the module I am developing. I am trying to export an ENUM. enums.ts export const enum PlayActi...
Marriageable asked 25/3, 2020 at 17:51

3

I have a case where I'm frequently checking both the value of a boolean and another union type together. While they're logically connected and could hypothetically just check one, I need to check b...
Langston asked 3/11, 2021 at 20:5

5

I'm doing a simple UPDATE with mysql2 : UPDATE table1 SET table1.value1 = ?, table1.value2 = ? WHERE user_id = ( SELECT user_id FROM user WHERE company_id = ? ) table1 is related to th...
Corson asked 2/6, 2020 at 15:49

3

Solved

I would like to initialize some important values when my application starts (Angular v17). app.config.ts: export const appConfig: ApplicationConfig = { providers: [ ConfigService, ... { provid...
Wurster asked 9/4 at 12:12

4

I have to use the react-password-checklist library to show the user if he is obeying the password rules declared in zod's schemaUser. However, I am not successful. obs: I'm using zod to validate th...
Scape asked 11/8, 2023 at 19:14

2

Solved

In our codebase we've been using T.lean() or T.toObject() and our return types would be LeanDocument<T>. Mongoose 7 no longer exports LeanDocument, and the existing migration guide suggests u...

2

I'm trying to catch http request's errors from an Angular interceptor and handle 401 as logout while retrying a 503 and 504 responses n times. This is my http interceptor: intercept(req: HttpRequ...
Centuple asked 18/4, 2019 at 15:16

3

Solved

How do I overrride the eslint rules in plugin:@nrwl/nx/typescript? I've made this change to the root of .eslintrc.json. "rules": { "@typescript-eslint/member-ordering": "w...
Nanna asked 4/6, 2021 at 18:7

4

I have been trying to figure out the preferred way of doing "Event Sourcing" while using the NestJS CQRS recipe (https://docs.nestjs.com/recipes/cqrs). I've been looking at the NestJS fra...
Bautram asked 23/12, 2018 at 18:6

2

I got error below than I inspect the error found - AWS$6.STS.prototype Uncaught TypeError: Cannot read properties of undefined (reading 'prototype') It build successfully. And I can upload file to ...
Charpoy asked 20/11, 2022 at 10:9

6

Solved

I've this Yeoman scaffolded project from the generator-express-no-stress-typescript template. I need to debug it, as in "step through the typescript code" with Visual Studio Code (and no,...

2

Inspection is raising this issue... according to this WebStorm blog post, I tried to update it but it's raising the same issue for these imports: server.ts .... // models import { IModel } from '...
Calliecalligraphy asked 29/3, 2017 at 8:16

3

Solved

I'm trying to use shaders with React-three-fiber and Typescript. Shader file: import { ShaderMaterial } from "three" import { extend } from "react-three-fiber" class CustomMate...
Schuler asked 26/12, 2020 at 17:42

6

I am currently working on a website using Next.js 14, with the aim of exporting it as a static site for distribution via a CDN (Cloudflare Pages). My site requires internationalization (i18n) suppo...

2

I'm working on a single-file script that is meant to be included on pages through a <script> tag, it's being built with Vite.js using the Terser minifier. After making changes I noticed that ...
Gilboa asked 3/10, 2021 at 18:5

2

The problem occurs for Vite monorepo, @ aliases are respected by TypeScript because of separate tsconfig files (can be visible in IDE) but aren't distinguished among the workspaces by Vite on build...
Shiller asked 9/2, 2023 at 19:49

3

Solved

I'm upgrading/refactoring an Angular project (to Angular 8, Electron 6, Ionic 4) and we decided to switch from TSLint to ESLint. I setup some rules and they are running but I can't get a rid off t...
Kailey asked 5/9, 2019 at 8:3

2

Solved

I need a NestJS interceptor that archives requests, both in exceptional and happy-path cases. Created as follows: public intercept(context: ExecutionContext, next: CallHandler): Observable<any...
Soapberry asked 8/7, 2019 at 4:46

2

I have a lot of Angular code where I assign a property at its definition like the following... public errors$ = this.store$.select(fromApp.getErrors); constructor(private store$: Store<MyStat...
Dayna asked 22/6, 2023 at 7:41

1

Solved

In React I am using @react-three/fiber for the 3D stuff. There are a lot components that don't support declarative way of doing things and require refs and imperative code (e.g. CameraControls from...
Touristy asked 24/9 at 12:51

1

I was experimenting on module alias for typescript and it works during dev, but when I try to build it I always get cannot find module because it is pointing to src file even on build. I tried repl...
Knossos asked 25/9, 2019 at 12:49

3

While using the sequelize-typescript npm When trying to invoke the Street.create(obj) I get an error: Argument of type 'plainObject' is not assignable to parameter of type 'Optional<Street, Nul...
Embezzle asked 6/11, 2022 at 14:24

4

Solved

I'm translating a node.js server to typescript. My funcion with node is: const storage = multer.diskStorage({ destination: function (req, file, cb) { const dir = './uploads/'; mkdirp(dir, err ...
Zebra asked 28/11, 2019 at 23:21

© 2022 - 2024 — McMap. All rights reserved.