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

216
Vistas
How to call a JavaScript class constructor from Blazor

If I have JavaScript classes defined in a library like three.js, how can I call the constructor from Blazor WebAssembly and instantiate objects?

I have tried

    var threeJs = await Js.InvokeAsync<IJSInProcessObjectReference>("import", "https://threejsfundamentals.org/threejs/resources/threejs/r125/build/three.module.js");
    var scn = threeJs.Invoke<IJSInProcessObjectReference>("new THREE.Scene");

but this results in an error saying "Microsoft.JSInterop.JSException: Could not find 'new THREE.Scene' ('new THREE' was undefined)."

Is it possible to instantiate JavaScript classes without making a JavaScript wrapper function which instantiates the object?

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

0

You can't call new THREE.Scene by itself. You can do something like const scene = new THREE.Scene. But, I don't know what good instantiating a variable in JSInterop would do.

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