Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 웹디자인
- chatGPT
- angular
- 플랫폼
- 디자인토큰
- 생성AI
- 프론트엔드
- 디자인
- 한글자동화
- blender
- UI
- CSS
- three.js
- 파이썬
- 리액트
- 3d
- frontend
- 업무자동화
- design token
- 데이터분석
- 문서자동화
- 디자인 토큰
- CINEMA4D
- 에어테이블
- SaaS디자인
- sass
- UX
- scss
- Airtable
- 에러노트
Archives
- Today
- Total
이게 무슨 일이야!
three.js + typescript (@types/three) 설정시 에러 해결 본문
three 라이브러리를
Webpack 사용하는 javascript 프레임워크에 세팅할 때 발생한 에러이다.
평소대로
npm i three @types/three
해서 라이브러리를 설치하면
아래와 같은 에러와 함께 빌드가 안되는 걸 볼 수 있다
TypeScript error TS1005: ';' expected
자동으로 버전이 맞춰지지 않아서 생기는 문제인데 이 때
package.json 의 typescript 버전과 @types/three 의 버전을 맞춰주면 해결된다
예를 들어 typescript 버전이
"typescript": "~4.2.3"
이면 아래 페이지에 접속해서
https://www.npmjs.com/package/@types/three?activeTab=versions
@types/three
TypeScript definitions for three. Latest version: 0.152.1, last published: 20 days ago. Start using @types/three in your project by running `npm i @types/three`. There are 344 other projects in the npm registry using @types/three.
www.npmjs.com
ts4.2 를 Tag 로 가지고 있는 Version 으로
"@types/three": "0.148.0",
이렇게 맞춰주면 해결된다
타이핑해서 버전을 바꿔준 경우
1. 기존 node_modules 폴더 삭제,
2. package_lock.json 삭제 후
3. npm i 해서 라이브러리 재설치
하면 깔끔하게 나오는 걸 볼 수 있다.
Comments