본문 바로가기

개발/JavaScript

Uncaught SyntaxError: Unexpected end of input

JavaScript에서 흔한 오류이다.

Uncaught SyntaxError: Unexpected end of input

 

1. 원인

- 닫히지 않은 소괄호, 중괄호(if, function...)가 원인이다.

2. 해결

https://jshint.com/ JavaScript의 오류를 체크해주는 사이트이다.

https://eslint.org/ 만약 Node.js이라면, eslint을 써보는 것도 좋다.