Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!