Skip to content

Circular dependency in NodeMaterial #26161

@RecuencoJones

Description

@RecuencoJones

Description

We are currently trying to move from three r144 to r152 and noticed a circular dependency was introduced in three/examples/jsm/nodes/materials/NodeMaterial.js with LightsNode.js.

When trying to build with webpack and the CircularDependencyPlugin, we get the following warnings:

WARNING in Circular dependency detected:
node_modules/three/examples/jsm/nodes/lighting/AnalyticLightNode.js -> node_modules/three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js -> node_modules/three/examples/jsm/nodes/materials/NodeMaterial.js -> node_modules/three/examples/jsm/nodes/lighting/LightsNode.js -> node_modules/three/examples/jsm/nodes/lighting/AnalyticLightNode.js

WARNING in Circular dependency detected:
node_modules/three/examples/jsm/nodes/lighting/LightsNode.js -> node_modules/three/examples/jsm/nodes/lighting/AnalyticLightNode.js -> node_modules/three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js -> node_modules/three/examples/jsm/nodes/materials/NodeMaterial.js -> node_modules/three/examples/jsm/nodes/lighting/LightsNode.js

WARNING in Circular dependency detected:
node_modules/three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js -> node_modules/three/examples/jsm/nodes/materials/NodeMaterial.js -> node_modules/three/examples/jsm/nodes/lighting/LightsNode.js -> node_modules/three/examples/jsm/nodes/lighting/AnalyticLightNode.js -> node_modules/three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js

WARNING in Circular dependency detected:
node_modules/three/examples/jsm/nodes/materials/NodeMaterial.js -> node_modules/three/examples/jsm/nodes/lighting/LightsNode.js -> node_modules/three/examples/jsm/nodes/lighting/AnalyticLightNode.js -> node_modules/three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js -> node_modules/three/examples/jsm/nodes/materials/NodeMaterial.js

Reproduction steps

  1. Import NodeMaterial
  2. Compile or Serve with webpack

Code

https://github.com/RecuencoJones/threejs-examples-circular-dependency/blob/main/src/index.js

Live example

Screenshots

No response

Version

r152

Device

Desktop

Browser

Edge

OS

MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions