three_mmi icon indicating copy to clipboard operation
three_mmi copied to clipboard

WARNING: Multiple instances of Three.js being imported.

Open thekubilay opened this issue 3 years ago • 4 comments

Hello, I got an issue when I import the the "@danielblagy/three-mmi" from node_modules like below.

import * as THREE from "three";
//@ts-ignore
import MouseMeshInteraction from '@danielblagy/three-mmi'
import {OrbitControls} from "three/examples/jsm/controls/OrbitControls";

the error only pops after I import MouseMeshInteraction from "@danielblagy/three-mmi"

thekubilay avatar Jun 27 '22 08:06 thekubilay

Hello! I tried using three_mmi and OrbitControls with webpack and it works fine (this setup https://github.com/designcourse/threejs-webpack-starter), so I wasn't able to reproduce it. Can you please specify what tools you're using.

Also, does the warning go away if you comment out the OrbitControls import and all the OrbitControls code?

Does the code work properly even with the warning?

danielblagy avatar Jun 27 '22 19:06 danielblagy

thank you for replying. I am on vite / vue 3 typescript.

actually code is working perfectly even with the warning but log error bothering me and maybe there is a performance issue coming from it..

additionally I comment out the orbit related code but the warning stay still.

by the way I tried to comment out my three import

// import * as THREE from "three";

thekubilay avatar Jun 28 '22 01:06 thekubilay

Okay, thank you.

I'll try to reproduce this issue and figure out what might be causing it. This may take me some time though.

danielblagy avatar Jun 28 '22 10:06 danielblagy

thank you, waiting for your update. hope, you figure it out and enlighten me about this.

thekubilay avatar Jun 28 '22 14:06 thekubilay