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

159
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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