knex-tiny-logger
knex-tiny-logger copied to clipboard
Typescript typings broken with Knex > 0.95
Related to #9, the Typescript typings are broken when using this package with the latest version of Knex:
node_modules/knex-tiny-logger/typings/index.d.ts:10:46 - error TS2709: Cannot use namespace 'Knex' as a type.
export default function knexTinyLogger(knex: Knex, options?: KnexTinyLoggerOptions): Knex
~~~~
node_modules/knex-tiny-logger/typings/index.d.ts:10:86 - error TS2709: Cannot use namespace 'Knex' as a type.
export default function knexTinyLogger(knex: Knex, options?: KnexTinyLoggerOptions): Knex
In my code I had to change:
import Knex from 'knex'
to:
import { Knex } from 'knex'
So it's probably something similar here.
- knex-tiny-logger 2.1.0
- knex 0.95.4
- typescript 4.2.4
I'm seeing the same issue. I can't upgrade from Knex v0.21.19 unless I remove this package.
Same here..
$ tsc && node dist/main.js
node_modules/knex-tiny-logger/typings/index.d.ts:10:46 - error TS2709: Cannot use namespace 'Knex' as a type.
10 export default function knexTinyLogger(knex: Knex, options?: KnexTinyLoggerOptions): Knex
~~~~
node_modules/knex-tiny-logger/typings/index.d.ts:10:86 - error TS2709: Cannot use namespace 'Knex' as a type.
10 export default function knexTinyLogger(knex: Knex, options?: KnexTinyLoggerOptions): Knex
~~~~
I submitted a PR here https://github.com/khmm12/knex-tiny-logger/pull/15
Hi,
I've create knex-little-logger, which is a drop-in replacement of knex-tiny-logger for Knex 0.95.
https://github.com/acro5piano/knex-little-logger
Key difference:
- supports only Knex >= 0.95
- bindings works
Knex changed a lot since 0.95 and some implementation of knex-tiny-logger no longer works. knex-little-logger does not depend on Knex's internal API.