IDE not recognizing Sequelize Constructor

The official docs for Sequelize show to use `const sequelize = new Sequelize()` for creating a connection pool.

But when used in the IDE, hints dont work unless I use `const sequelize = new Sequelize.Sequelize()`

How do I fix this in Webstorm ?

2 comments
Comment actions Permalink

Well... this happens because of a way the module typings are defined

The error will go away if you change the import to

const { Sequelize } = require('sequelize');

as suggested in https://sequelize.org/master/, or to

import {Sequelize } from "sequelize";

per instructions at https://sequelize.org/master/manual/typescript.html

 

 

0

Please sign in to leave a comment.