Skip to content

Commit

Permalink
better log for duplicate three.js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Jul 24, 2024
1 parent 22daa79 commit f37eac2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Three.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,21 @@ if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {

if ( typeof window !== 'undefined' ) {

try {

if ( import.meta ) {

if ( ! window.__THREE__IMPORTS__) window.__THREE__IMPORTS__ = [];
window.__THREE__IMPORTS__.push( { url: import.meta.url, revision: REVISION } );

}

} catch { }

if ( window.__THREE__ ) {

console.warn( 'WARNING: Multiple instances of Three.js being imported. Existing: ' + window.__THREE__ + ', new: ' + REVISION );
console.warn( window.__THREE__IMPORTS__ );

} else {

Expand Down

0 comments on commit f37eac2

Please sign in to comment.