Recently I was learning about the Sequelize module and used the following in my code to import the module:
const Sequelize = require('sequelize')
const sequelize = new Sequelize( ... {
...
})
Every thing worked as expected, db connection, queries, updates, deletes, etc, the only issue was that my auto complete was totally broken.
After looking at the docs I found the proper way to import was to use destructuring and now my auto complete started to work
const { Sequelize } = require('sequelize')
My question is, if the first import was incorrect why was the module still able to function correctly? Is there some functionality that is able to find the correct object that I was trying to use, but the language server was unable to find it?