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

303
Visualizações
Typescript 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type

In my nextjs project I have this code:

const go = new global.Go()

global.Go is defined through wasm.

When I run the tsc command I get the following error:

error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.

So I've created the file types/global.d.ts and I have add these lines:

export declare global {
  function Go(): unknown
}

but now I get this error:

error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

How can I solve this issue?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Like the error message says; give it a construct signature

export declare global {
  const Go: new () => Go
}
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