I'm developing a Blazor WASM application where I make use of the Microsoft.TypeScript.MSBuild nuget package in order to use typescript for all related javascript code.
But when it comes to import and use an external js module like three I have no way to import or set it up and use it from my typescript code.
I've tried with several approaches, my last one, having it installed via npm, but still in my ts files there is a build error in the import, where 'three' is not recognized:
import * as THREE from 'three';(TS) Cannot find module 'three'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
Changing this from the tsconfig.json (not in use anymore) does not result in this working.
Also I tried to use this from a JS file I've set just for this purpose and when it is being loaded by the browser, I get an error like this:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]Unhandled exception rendering component: Unexpected identifier 'as'SyntaxError: Unexpected identifier 'as'Microsoft.JSInterop.JSException: Unexpected identifier 'as'SyntaxError: Unexpected identifier 'as'at Microsoft.JSInterop.JSRuntime.d__16`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()
I'm out of ideas to keep trying. Also I don't find many things on the net, and all examples I found are using just one ts file, not importing a JS module.