npx로 typescript 프로젝트를 만들었을때 vscode에서 위와 같은 에러가 발생했다.

구글링 중에 tsconfig.json의 내용을 바꾸라는 내용이 다수였는데 이 방법 보다 더 정확해 보이는 해결책을 찾았다.

stackoverflow.com/questions/50432556/cannot-use-jsx-unless-the-jsx-flag-is-provided

 

Cannot use JSX unless the '--jsx' flag is provided

I have looked around a bit for a solution to this problem. All of them suggest adding "jsx": "react" to your tsconfig.json file. Which I have done. Another one was to add "include: []", which I hav...

stackoverflow.com

cmd + shift + p -> select typescript version -> Use Workspace Version 4.x.x 로 변경하니 error가 사라졌다.

이걸 설정하기 전 typescript버전은 3.x.x였는데 4.x.x로 변경했더니 문제가 사라졌다.

'Programming > JavaScript' 카테고리의 다른 글

event.stopPropagation(), event.preventDefault () 이해하기  (0) 2014.10.20
[JAVASCRIPT] replace  (0) 2013.05.08

+ Recent posts