-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use namespace 'Knex' as a type #259
Comments
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 Of course this doesn't change whats created via the CLI but should allow it all to compile in the meantime. |
This seems to be an issue with the feathers-knex library as well. Not only the generator's output.
Downgrading to a pre 0.95.0 version of Knex solves the issue. |
I am also having this issue. |
Update Knex type definition import for 0.95.x. feathersjs-ecosystem#259 Reference: https://github.com/knex/knex/blob/master/UPGRADING.md
Temperary solution: Edit tsconfig.json {
"compilerOptions": {
"skipLibCheck": true
}
}
|
Update Knex type definition import for 0.95.x. #259 Reference: https://github.com/knex/knex/blob/master/UPGRADING.md
Closed via #262 |
Steps to reproduce
Generated a clean app with TypeScript enabled
feathers generate app
Generate a new service with
feathers generate service
and choose KnexJS as service typeExpected behavior
When starting the app (nom start) tsc should compile successfully.
Actual behavior
Lots of errors about Knex namespace. E.g:
System configuration
Module versions (especially the part that's not working):
NodeJS version:
15.14.0
Operating System:
macOS Big Sur 11.2
The text was updated successfully, but these errors were encountered: