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

310
Vistas
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 Respuestas
Responde la pregunta

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 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