(typescript) Error: /.../knextest/src/index.ts(3,15): semantic error TS2694: Namespace '"/.../knextest/node_modules/knex/types/index".Knex' has no exported member 'QueryBuilder'.
Error: /.../knextest/src/index.ts(3,15): semantic error TS2694: Namespace '"/.../knextest/node_modules/knex/types/index".Knex' has no exported member 'QueryBuilder'.
at error (/.../knextest/node_modules/rollup/dist/shared/node-entry.js:5400:30)
at throwPluginError (/.../knextest/node_modules/rollup/dist/shared/node-entry.js:11878:12)
at Object.error (/.../knextest/node_modules/rollup/dist/shared/node-entry.js:12912:24)
at Object.error (/.../knextest/node_modules/rollup/dist/shared/node-entry.js:12081:38)
at RollupContext.error (/.../knextest/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:17237:30)
at /.../knextest/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:25033:23
at arrayEach (/.../knextest/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:545:11)
at Function.forEach (/.../knextest/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9397:14)
at printDiagnostics (/.../knextest/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:25006:12)
at Object.transform (/.../knextest/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29277:17)
Expected behavior
Compiling this index.ts by hand with tsc throws no errors and my IDE LSP is also ok with this code.
So (maybe incorrectly?) I'm expecting tsdx compilation to now throw an error as well.
Suggested solution(s)
I suppose the issue is somewhere within a rollup plugin potentially? I'm a bit unfamiliar with this stack thanks to tsdx abstracting it away..
It seems to me that tsdx compilation process is confused with namespaces and interfaces under the same name that Knex project defines?
Current Behavior
Compilation throws an error.
Test repo is here, https://github.com/leshy/knextest
File in question https://github.com/leshy/knextest/blob/main/src/index.ts
Expected behavior
Compiling this
index.ts
by hand withtsc
throws no errors and my IDE LSP is also ok with this code.So (maybe incorrectly?) I'm expecting tsdx compilation to now throw an error as well.
Suggested solution(s)
I suppose the issue is somewhere within a rollup plugin potentially? I'm a bit unfamiliar with this stack thanks to tsdx abstracting it away..
It seems to me that tsdx compilation process is confused with namespaces and interfaces under the same name that
Knex
project defines?This is a type def file in question on knex side: https://github.com/knex/knex/blob/master/types/index.d.ts
Your environment
Thanks!