报错
✘ [ERROR] Two output files share the same path but have different contents: node_modules/.vite/deps_temp_c5811052/three_examples_jsm_controls_orbitControls__js.js
7:48:33 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
error: Two output files share the same path but have different contents: node_modules/.vite/deps_temp_c5811052/three_examples_jsm_controls_orbitControls__js.js
at failureErrorWithLog (/Users/wangzhongqing/Desktop/Mine/my-threejs-import/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:1472:15)
at /Users/wangzhongqing/Desktop/Mine/my-threejs-import/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:945:25
at /Users/wangzhongqing/Desktop/Mine/my-threejs-import/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:1353:9
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
截图如下
解决
// 有问题的
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
// 解决的:小写即可
import { OrbitControls } from 'three/examples/jsm/controls/orbitControls.js'