model type can not be infer because of the lack of @types/bluebird
See original GitHub issueWhat are you doing?
I am using sequelize
with typescript. Below is my demo file
// code here
import {Sequelize, Model, STRING, DATE} from 'sequelize'
const sequelize = new Sequelize('postgres://user:pass@example.com:5432/dbname');
class User extends Model {}
User.init({
username: STRING,
birthday: DATE
}, { sequelize });
User.create({
username: 'janedoe',
birthday: new Date(1980, 6, 20)
}).then(vvvv => {
})
What do you expect to happen?
vvvv
should be infer to type User
, but it doesn’t.
What is actually happening?
vvvv
is infer to any
.
when I run npm i @types/bluebird
, the infer works.
Dialect: any Dialect version: any Database version: any Sequelize version: 5.2.7 Tested with latest release: Yes. 5.2.7
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Problems inferring type with typescript - Stack Overflow
There is currently are less than intuitive ways to get Bluebird promises to override the global Promise that TypeScript provides.
Read more >Does type inference renders the code less readable - Reddit
Yes and no. A good IDE for a type-inferred language can display the types of variables automatically, so that the type of the...
Read more >gitignore and change to database (ea03ea61) · Commits ... - GitLab
Alias for `router.delete()` because delete is a reserved word ... the return type propagation of generators to automatically infer the return type T....
Read more >licenses_clients_v23.txt - Pexip Infinity Docs
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ......
Read more >Dependencies | ozone-item-preview | npm | Open Source Insights
Errors found while resolving dependencies: could not find a version that satisfies requirement git+https://git@bitbucket.taktik.be/scm/sandbox/ozone-type.git ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
When I crll+F
typescirpt
in README. I only found this url: https://github.com/RobinBuschmann/sequelize-typescriptAccording to https://github.com/RobinBuschmann/sequelize-typescript/issues/587#issuecomment-478332149 . You have a typescript guide here: http://docs.sequelizejs.com/manual/typescript.html . So if make it obvious, it would be nice.
🎉 This issue has been resolved in version 5.2.11 🎉
The release is available on:
Your semantic-release bot 📦🚀