Comments (5)
I had the same issue using the Objection driver which also utilises Knex. To fix it you should just need to change the import statement in src/models/users.model.ts from import Knex from 'knex';
to import {Knex} from 'knex';
.
Of course this doesn't change whats created via the CLI but should allow it all to compile in the meantime.
from feathers-knex.
This seems to be an issue with the feathers-knex library as well. Not only the generator's output.
I get these errors when compiling:
node_modules/feathers-knex/types/index.d.ts:8:10 - error TS2709: Cannot use namespace 'Knex' as a type.
8 Model: Knex;
~~~~
node_modules/feathers-knex/types/index.d.ts:15:64 - error TS2709: Cannot use namespace 'Knex' as a type.
15 function start(options?: { getKnex: (hook: HookContext) => Knex | undefined }): Hook;
~~~~
node_modules/feathers-knex/types/index.d.ts:22:10 - error TS2709: Cannot use namespace 'Knex' as a type.
22 Model: Knex;
~~~~
node_modules/feathers-knex/types/index.d.ts:23:9 - error TS2709: Cannot use namespace 'Knex' as a type.
23 knex: Knex;
~~~~
node_modules/feathers-knex/types/index.d.ts:29:24 - error TS2709: Cannot use namespace 'Knex' as a type.
29 db(params?: Params): Knex;
~~~~
node_modules/feathers-knex/types/index.d.ts:31:33 - error TS2709: Cannot use namespace 'Knex' as a type.
31 createQuery(params?: Params): Knex;
~~~~
Downgrading to a pre 0.95.0 version of Knex solves the issue.
from feathers-knex.
I am also having this issue.
from feathers-knex.
Temperary solution:
Edit tsconfig.json
{
"compilerOptions": {
"skipLibCheck": true
}
}
from feathers-knex.
Closed via #262
from feathers-knex.
Related Issues (20)
- An in-range update of @feathersjs/adapter-commons is breaking the build 🚨 HOT 2
- An in-range update of knex is breaking the build 🚨 HOT 6
- Add array-type operators HOT 1
- An in-range update of @feathersjs/adapter-commons is breaking the build 🚨 HOT 1
- Feathers Knex generating bad COUNT query when using [$in] operator with only one value (sqlite) HOT 1
- Feathers-knex, REST and PostGIS — include examples? HOT 3
- Create method with knex plugged with mssql database returns no id. Gets General Error in feathers api HOT 2
- An in-range update of knex is breaking the build 🚨 HOT 5
- Closing the database connection / cleanup ? HOT 2
- SQL Server "Cannot read property '0' of undefined" when create HOT 1
- `find` adds the `id` column automatically with no easy way to remove it HOT 1
- No release
- Authenticate Hook => Create an unwanted query parameter 'Authorization' HOT 2
- Dynamically changing the knex schema based on request
- Fix types to work with knex > 0.95
- Re-run migrations? HOT 1
- Meta fields missing (`total`, `skip`, ...) HOT 2
- Paginated results incorrect without $sort
- Search with $ilike a value into a json column type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feathers-knex.