Cannot find module 'three/webgpu' or its corresponding type declarations

I wanted to add a GLB model into my angular 15 project, and getting this error Error:


This is my three.js version


I want know how to fix that

three/webgpu isn’t recognized (yet) out of the box
as manthrax wrote, you have to either use importmap or a complete path

another trick is current addons always import three. some cases could require to open the script and use three/webgpu instead (like GLTFloader, line 67). But once again it depend. If you forward three to the gpu version it is not necessary (theorically) , but if you importmap three/webgpu you rather do it.

1 Like

following people having issue with this from discord help channel, seem this is indeed not working well. There is some throttle in place I guess? Don’t leech from three.org :laughing:

2 Likes

Yea.. feel free to post the correct package setup and importmap then.

1 Like

three.webgpu.js (1.6 MB)

@FiveToedJerboas

Grab this ^

Put it somewhere in your source tree and import it…

import *as THREE from "yourpath/three.webgpu.js"
1 Like

Thanks for everyone’s answers but I still can’t solve maybe I didn’t describe the problem. :joy:My native language is not English,I commented some code for KTX2Loader.d.ts ,My project is run,Maybe this error can fix in the future

1 Like
2 Likes

As @manthrax pointed out, you’ll also need to install the types, and make sure they’re the same version as the installed three package, especially with three/webgpu as the updates are quite often.

npm install three@0.174.0 @types/three@0.174.0
1 Like