Sequelize constructor
See original GitHub issueHey! I have a (maybe) stupid question about the type definition for sequelize. I’m using
const Sequelize = require('sequelize');
const sequelize = new Sequelize(
config.database,
config.username,
config.password,
config
);
Flow do read the type definition and if I type Sequelize.
I get an autocomplete with a bunch of options. But flow doesn’t think Sequelize is a function. I don’t know if this is because the typedef is wrong or if I’m doing something wrong.
This is the flow error I get:
[flow] Cannot call `Sequelize` because module `sequelize` [1] is not a function. (References: [1])
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Getting Started - Sequelize
The Sequelize constructor accepts a lot of options. They are documented in the API Reference. Testing the connection.
Read more >Static Method Summary - Sequelize
constructor (database: string, username: string, password: string, options: object). Instantiate sequelize with name of database, username and password.
Read more >Dialect-Specific Things - Sequelize
dialectOptions are passed directly to the MariaDB connection constructor. A full list of options can be found in the MariaDB docs. SQLite. The ......
Read more >Model Instances - Sequelize
As you already know, a model is an ES6 class. An instance of the class represents one object from that model (which maps...
Read more >Options | @sequelize/core
Options for the constructor of the Sequelize main class. Hierarchy. Logging. Options. Defined in types/sequelize.d.ts: ...
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 FreeTop 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
Top GitHub Comments
if I replace
export default class Sequelize
byexport class Sequelize
and change codeconst { Sequelize} = require('sequelize');
it worksI see, huh, I haven’t seen a situation where it was that difficult to add Babel into an existing project…