FrontEnd/JavaScript
에러해결 : Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
SangHoonE
2021. 11. 1. 22:51
안녕하세요 상훈입니다.
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
Vue.js , API, Fetch(), 비동기 통신 간에 에러가 발생하였습니다.
이 에러가 처음에는 제가 오타를 내서 발생한 에러인줄 알았으나(근데 오타도 있었음),
오타의 문제가 아니었습니다.
1. F12 -> Network 를 확인해주세요.
2. api를 가져올 때 주소를 잘못 작성한 것을 저는 확인하였습니다.
그리고 다시 url_base를 사용하니 원활히 출력되었습니다!
주소 주의하세욤..
이상입니다.
참고
React Js: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
I want to fetch my Json file in react js, for this I am using fetch. But it shows an error Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 What could be the error,...
stackoverflow.com
반응형