Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6208

JSON Parse error: Unexpected EOF in React Native Expo

$
0
0

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

Viewing all articles
Browse latest Browse all 6208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>