Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda