R168 Error after install: No matching export in "./three.module.js" for import "NodeMaterial"

After installing r168 , vite.js prints this error.

 [ERROR] No matching export in "node_modules/three/build/three.module.js" for import "NodeMaterial"

    node_modules/three/examples/jsm/objects/SkyMesh.js:5:1:
      5 │   NodeMaterial,
        ╵   ~~~~~~~~~~~~

X [ERROR] No matching export in "node_modules/three/build/three.module.js" for import "NodeMaterial"

    node_modules/three/examples/jsm/objects/WaterMesh.js:4:1:
      4 │   NodeMaterial,
        ╵   ~~~~~~~~~~~~

X [ERROR] No matching export in "node_modules/three/build/three.module.js" for import "NodeMaterial"

    node_modules/three/examples/jsm/objects/Water2Mesh.js:4:1:
      4 │   NodeMaterial,
        ╵   ~~~~~~~~~~~~

NodeMaterial only exists in three.webgpu.js and it’s looking for it in three.module.js and my project does not use webGPU or any of these 3 files.

by downgrading to r167 this issue is gone.

what could be the fix here ? or is this a bug/typo

That looks like a mistake in SkyMesh.js etc., the NodeMaterial import should be coming from three/webgpu or three/tsl, not three. Interesting that the website example is still working though… :confused:

1 Like

example page uses

<script type="importmap">
			{
				"imports": {
					"three": "../build/three.webgpu.js",
					"three/tsl": "../build/three.webgpu.js",
					"three/addons/": "./jsm/"
				}
			}
		</script>

so the import works there correctly,

should i make a bug report ?

I am not sure if this might be applicable to this issue but @Attila_Schroeder had a topic suggesting to update entries in the package.json file for use with vite and webgpu.

I cannot find that topic any longer but it doesn’t hurt to ask him.

should i make a bug report ?

Sure, that or a PR would be good I think!

… a topic suggesting to update entries in the package.json file for use with vite and webgpu.

I think that’s Provide a WebGPU build that re-exports from three · Issue #29156 · mrdoob/three.js · GitHub, somewhat related yes.

What I mentioned was happening in this forum but can’t really be smart about this since the topic was removed but @vis_prime could possibly check any relevant entries in the Ocean Demo repository.

PR:

2 Likes

I have completely overlooked what @vis_prime stated in the first post: my project does not use webGPU or any of these 3 files, so whatever I stated was just plain gibberish. My apologies.

Thank goodness that @donmccurdy is reading posts carefully.

1 Like

I think you’re right about the connection to the other issue though! The problem @vis_prime found would have been discovered much sooner if the examples weren’t rewriting the three import like this, which is related to the needed package.json changes.

2 Likes

issue fixed in r169 :partying_face: :partying_face:

2 Likes