I'm getting JSON Parse error: Unexpected EOF in Expo app.
I'm not sure why this issue occurred.
export const serviceCaller = <TResp>(url: string, request: HttpRequest): Promise<TResp> => {
return new Promise<TResp>(async (resolve) => {
try {
const response = await fetch(url, request);
const json: TResp = await response.json();
resolve(json);
} catch (error) {
console.log(error);
resolve(null);
}
});
};
Error list:
- JSON Parse error: Unexpected EOF
- node_modules\promise\setimmediate\core.js:37:14 in tryCallOne
- node_modules\promise\setimmediate\core.js:123:25 in
- ... 8 more stack frames from framework internals