three.js模块引入报错解决
·
Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
<script type="module">
import * as THREE from './build/three.module.js'
import { PointerLockControls } from './jsm/controls/PointerLockControls.js'
</script>
通过type="module"引入three.js可能会引起该报错
可以加上以下代码解决
<script type="importmap">
{
"imports": {
"three": "./build/three.module.js"
}
}
</script>
更多推荐
已为社区贡献1条内容
所有评论(0)