Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Node js proper module imports

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!