Skip to content

[Bug/Packaging] IIFE logs “Multiple instances of Three.js being imported” #91

Description

@SamuelAB-VIM

Environment

  • vim-web 1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via <script>
  • API: VIM.Core.Webgl.createViewer() (headless, custom UI)
  • Chromium / desktop, devicePixelRatio 1.75
  • Model: 2,547 elements (2,264 with geometry), 12 Revit categories, structural

Summary. Loading dist/vim-web.iife.js prints three.js's multi-instance warning on every
page load:

WARNING: Multiple instances of Three.js being imported.

Likely cause. three appears to be bundled more than once (or a dependency bundles its own
copy) inside the IIFE rather than deduped to a single instance.

Impact. Beyond bundle size, multiple three instances can cause instanceof / material /
class-identity mismatches. (In our app VIM.THREE.Color worked for color overrides, so the
public VIM.THREE is at least the renderer's instance — but the warning suggests an internal
duplicate worth removing.)

Ask. Dedupe three to a single instance in the build (e.g. resolve/alias all three
imports to one copy).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions