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 |
Tags
- 에스프레소샷
- 감기약
- 피스타치오라떼
- 만두레시피
- 의약품안전
- 터미널사진편집
- 카페일상
- 고양이
- 면접준비
- 터미널사진사이즈변경
- 거미
- 고양이귀여움
- 초코만두
- 딸꾹질대처법
- 거미줄의비밀
- 내일부터출근
- 벌루닝
- 딸꾹질멈추는법
- 탄수화물소화
- 자연의과학
- 생물학습
- 딸꾹질원인
- 디저트아이디어
- 식곤증
- 코포나시럽
- 딸꾹질
- 라떼이야기
- 창의적인요리
- 한외마약
- 건강정보
Archives
- Today
- Total
SP'S SPARKING
[해결] TypeError: Failed to fetch 본문
ERROR CODE:
index.js:1 TypeError: Failed to fetch
at searchCode (:3000/static/js/main.chunk.js:3348:5)
at HTMLUnknownElement.callCallback (:3000/static/js/vendors~main.chunk.js:17235:18)
at Object.invokeGuardedCallbackDev (:3000/static/js/vendors~main.chunk.js:17284:20)
at invokeGuardedCallback (:3000/static/js/vendors~main.chunk.js:17346:35)
at invokeGuardedCallbackAndCatchFirstError (:3000/static/js/vendors~main.chunk.js:17361:29)
at executeDispatch (:3000/static/js/vendors~main.chunk.js:22190:7)
at processDispatchQueueItemsInOrder (:3000/static/js/vendors~main.chunk.js:22222:11)
at processDispatchQueue (:3000/static/js/vendors~main.chunk.js:22235:9)
at dispatchEventsForPlugins (:3000/static/js/vendors~main.chunk.js:22246:7)
at :3000/static/js/vendors~main.chunk.js:22438:16
at batchedUpdates$1 (:3000/static/js/vendors~main.chunk.js:39073:16)
at batchedUpdates (:3000/static/js/vendors~main.chunk.js:17061:16)
at dispatchEventForPluginEventSystem (:3000/static/js/vendors~main.chunk.js:22437:7)
at dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay (:3000/static/js/vendors~main.chunk.js:19613:9)
at dispatchEvent (:3000/static/js/vendors~main.chunk.js:19605:9)
at dispatchDiscreteEvent (:3000/static/js/vendors~main.chunk.js:19578:9)
TRY
여러가지 찾아봤다. https 를 http 로 바꿔라 (안됨), 서버 다시 껐다 켜봐라 (안됨), fetch 구조도 바꿔봤는데 안됨
이리저리 하다가
SOLVED
e.preventDefault();
이거 넣으니까 됐다. 아니 근데 아까도 이거 한거같은데 왜 그땐 안됐지? 오늘도 느끼는 알 수 없는 코딩 세계
const searchUser = (e) => {
e.preventDefault();
fetch('/search/' + userID)
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err))
}
728x90