-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Generated typescript migrations and seeds have type errors #2808
Comments
Wouldnt it be better to declare function as async?
|
Yes that's what I started doing shortly after filing the issue, should have updated it. |
Could also use ie
|
Fixed #2816 |
(function (exports, require, module, __filename, __dirname) { import ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Knex version: 0.15.2
Bug
Getting type errors, shouldn't have any.
This is because the bluebird promise type is incompatible with the typescript Promise type. This can fixed by simply wrapping the function body in Promise.resolve(...) and returning that instead.
Example (seed file, needs to be fixed with migration as well)
Current generated code
Code that typechecks correctly by adding Promise.resolve(...)
The text was updated successfully, but these errors were encountered: