Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
Typescript IntelliSense throw error: Property 'customSelect' does not exist on type 'Knex<any, unknown[]>'

I have a typescript IntelliSense problem.

I want to add a new method to knex in typescript as written in the docs (search "Extending Query Builder").

So I create knex.d.ts in @types folder with this content:

// knex.d.ts
import { Knex as KnexOriginal } from 'knex';
declare module 'knex' {
  namespace Knex {
    interface QueryBuilder {
      customSelect<TRecord, TResult>(value: number): KnexOriginal.QueryBuilder<TRecord, TResult>;
    }
  }
}

And add this code to my tsconfig.base.json:

// tsconfig.json
{
  "compilerOptions": {
    "typeRoots": [ "node_modules/@types", "@types" ],
  }
}

But I got an error in typescript:

Property 'customSelect' does not exist on type 'Knex<any, unknown[]>'.

enter image description here

The error is point to the foo-lib at authDb.customSelect(); and authDb.select().customSelect();.

What I am doing wrong??

I create a repo to reproduce the problem: https://github.com/wizardnet972/nx-knex

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda