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

157
Vistas
Typescript scoped variable with generated javascript file

I'm just learning typescript and following an online course. I've hit a bit of a snag immediately and must be a vscode setting or something?

When I compile app.ts it generates the app.js but immediately I get a typescript error because the person variable is conflicting with the person variable in the app.js which was just generated. The error is "Cannot redeclare block-scoped variable".

Can someone tell me how to avoid this?

app.ts

app.js

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Resolved in the comments:

In absence of a tsconfig.json file, TypeScript (built into Visual Studio Code) treated your JS output directory as an input directory. The problem was solved by creating the file; if the file existed, it would require configuring TypeScript not to treat its output as additional input via includes, excludes, or files configurations (or by setting an outFile or outDir).

about 4 years ago · Juan Pablo Isaza Denunciar
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