0
点赞
收藏
分享

微信扫一扫

three.js模块引入报错解决

龙驹书房 2022-04-13 阅读 64

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>
举报

相关推荐

0 条评论