leegeunhyeok / school-kr

🍚🍴 전국 교육청 급식, 학사일정 파싱 라이브러리
https://www.npmjs.com/package/school-kr
MIT License
47 stars 11 forks source link

학교 정보 fetch 안됨 #9

Open chemistryx opened 4 years ago

chemistryx commented 4 years ago

학교 정보를 받아오려고 하면 다음과 같은 오류가 발생합니다.

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'res.headers['set-cookie'].join')]
- node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in callFunctionReturnFlushedQueue

Stacktrace에서 보았을 때 이곳에서 오류가 발생하는 것으로 보입니다. 버전은 최신 버전(3.0.0) 사용중입니다.

leegeunhyeok commented 4 years ago

리액트 네이티브 환경이신 것 같은데 조금 더 자세한 환경 정보를 알려주실 수 있으신가요?

예) Window 10, Node.js 10.x, 코드 예시 등

chemistryx commented 4 years ago

macOS 10.15, node v12.10 사용중이며 코드는 예제와 같은걸 사용했습니다.

leegeunhyeok commented 4 years ago

아래의 환경에서 테스트 진행 결과 정상 동작함을 확인했습니다.

RN 구성환경에서의 문제인것으로 확인되는데 RN 환경 구성 후 테스트를 진행하려면 시간이 더 소요될 것 같습니다.

관련 문제 리서치 후(참고), withCredentials 옵션을 axios 요청에 추가한 상태입니다.

현재 배포된 상태는 아니며 여기에 코드가 추가되어있으니 직접 클론하여 테스트 하실 수 있다면 확인 부탁드립니다.

이후 테스트 진행되는대로 수정하여 배포할 예정입니다.

감사합니다.

chemistryx commented 4 years ago

로컬에서 테스트 해본 결과 동일한 오류가 발생합니다. 특이한 점이 있다면 최초 1회는 정상적으로 불러오는데 그 이후부터는 작동하지 않습니다.