Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!