문제 발생
처음 three js 를 이용하여 npm i three해서 다운 받아서 아래처럼 import를 하였는데 제목 처럼 해당 오류가 발생하였다.
import * as THREE from "three";
문제 해결
index.html에 직접 three 공식 홈페이지에서 모듈을 가져올 수 있게 지정을 해주니깐 제대로 작동하였다.
<script type="importmap">
{
"imports": {
"three": "https://threejs.org/build/three.module.js",
}
}</script>
참고자료