Closed flowers-10 closed 3 months ago
Do you mind trying it with this Vite configuration: https://github.com/mrdoob/three.js/pull/28650#issuecomment-2198568721
I think imports from three/webgpu may need to be avoided somehow here:
/ping @Methuselah96
It sounds like you probably have moduleResolution
set to either node
/node10
in your tsconfig.json
(implicitly or explicitly) which should no longer be used. See this guide for advice on how to configure TypeScript to resolve this.
See https://github.com/three-types/three-ts-types/issues/1136 for more info and/or to discuss further.
Merging this issue into https://github.com/three-types/three-ts-types/issues/1136.
// tsconfig.json
import { defineConfig } from 'vite';
{
"compilerOptions": {
"paths": {
"three/webgpu": ["./node_modules/three/build/three.webgpu.min.js"]
},
}
}
Description
I have no issues using version 0.166.0.
0.167.1: yarn run build yarn run v1.22.19 $ vue-tsc && vite build node_modules/@types/three/examples/jsm/loaders/KTX2Loader.d.ts:2:42 - error TS2307: Cannot find module 'three/webgpu' or its corresponding type declarations. There are types at '/Users/channel1/Desktop/Project/DigitalTwin/node_modules/@types/three/build/three.webgpu.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
2 import { Renderer, WebGPURenderer } from "three/webgpu"; error Command failed with exit code 2.
Reproduction steps
1.version: "@types/three": "^0.167.1","three": "^0.167.1", 2.yarn run build 3.error Command failed with exit code 2.
Code
Live example
Screenshots
Version
r167.1
Device
No response
Browser
No response
OS
No response