No tengo ni idea de por qué recibo este error y qué podría estar saliendo mal. Aquí hay un desglose de lo que está sucediendo:
import * as THREE from "three"; import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js"; import { MeshLine, MeshLineMaterial, MeshLineRaycast } from 'three.meshline';Luego comencé a agregar líneas y cajas y esas cosas. 3) Este es un error que sigo recibiendo:
ADVERTENCIA: Se están importando varias instancias de Three.js.
var THREE = root.THREE || (has_require && require('three')) if (!THREE) throw new Error('MeshLine requires three.js')También traté de importar los archivos de esta manera:
import {PerspectiveCamera, AmbientLight, DirectionalLight, WebGLRenderer, Color, Scene, sRGBEncoding} from "three";Pero eso tampoco ayudó
EDIT 2: Intenté la window.THREE = THREE; eso tampoco funciono
También aquí hay un repositorio que he creado que replica este error: https://github.com/range-et/THREE_THREEMESHLINE