#Sebboseb-expo

1 messages ยท Page 1 of 1 (latest)

final sand
#

Hello ๐Ÿ‘‹
can you share a screenshot of the error as well as your example code?

white dawn
#

yeah one minute

#

Okay so this is the first error, ```js
[Unhandled promise rejection: SyntaxError: JSON Parse error: Unrecognized token '<']
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:123:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:177:14 in _callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:437:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:388:6 in __callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:132:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:365:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:131:4 in flushedQueue

#

and when I visit the url and go to network, this is how the response looks

#
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /null</pre>
</body>
</html>
#

So there is something wrong with doing this via expo go I think

#

And this is my code

restive kiln
#

Hi ๐Ÿ‘‹ I'm stepping in for @final sand
Give me a minute to catch up

#

For starters it doesn't look like the request is well formed. Apparently you are making a request to /null which the server is not configured for.

white dawn
#

Yeah I just don't get how, the code is the same, only thing that's changed is I'm connecting through expo go

restive kiln
#

Well the first thing I would do is log the values of the variables you are using to build the URL.

restive kiln
#

What method call is triggering this URL?

white dawn
#
const fetchPaymentIntentClientSecret = async () => {
        const response = await fetch(`${API_URL}/create-payment-intent`, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({
                paymentMethodType: 'card',
                currency: 'usd',
            }),
        });
        const { clientSecret } = await response.json();

        return clientSecret;
    };
``` This right? In handlePayPress
#

Refused to load the image 'http://xxx.xxx.xxx.xxx:19000/null' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

This is what it says when I go here v

#

But I might try switching over to my mac and run it on a sim instead so I can confirm if it's because of expo go

restive kiln
#

Okay hold on

#
  1. Can you confirm that the resources your application expects are reachable to the API url?