Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda