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

252
Views
Multiple versions of Three.Js being imported?

I'm a bit clueless as to why I'm getting this error and what could possibly be going wrong? Here's a breakdown of what's happening:

  1. I started up an NPM/webpack app
  2. Then I imported in three js and three mesh line:
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
import { MeshLine, MeshLineMaterial, MeshLineRaycast } from 'three.meshline';

I then started adding in lines and boxes and stuff. 3) This is an error that I keep getting:

WARNING: Multiple instances of Three.js being imported.

  1. To debug this I commented out the line of code for Meshline - which does get rid of this issue.
  2. So I had a snoop around the MeshLine file and it looks like this:
var THREE = root.THREE || (has_require && require('three'))
  if (!THREE) throw new Error('MeshLine requires three.js')
  1. My working theory is that its not multiple versions but multiple different times that its getting imported. and this is happening because I have something as THREE and as three.
  2. Is this intuition right? And what do I do to fix it?

EDIT 1: Browser output

I also tried to import the files in like so:

import {PerspectiveCamera, AmbientLight, DirectionalLight, WebGLRenderer, Color, Scene, sRGBEncoding} from "three";

But that didn't help either

EDIT 2: Tried the window.THREE = THREE; that didn't work either

Also here is a repo that I have created that replicates this error : https://github.com/range-et/THREE_THREEMESHLINE

about 4 years ago · Juan Pablo Isaza
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!