#demodian_error

1 messages ¡ Page 1 of 1 (latest)

rancid marshBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1390388930506920178

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

upbeat crown
#

I've also removed and reinstalled @stripe/stripe-terminal-react-native module to get the latest version with no luck

#

I need to emphasize that I need to use web testing to do this. I have not started to use a device yet for testing, as I want to get the flow of our app done before worrying about emulators or devices

loud latch
#

Hi! Can you share the code that's throwing this error?

upbeat crown
#

import { Reader, requestNeededAndroidPermissions, StripeTerminalProvider, useStripeTerminal } from '@stripe/stripe-terminal-react-native';

just having this line in my app, it gives

Cannot read properties of undefined (reading 'getConstants')

when web testing with expo/Metro

#

I have NOT started device testing, but considering that terminal sdk should support internet devices, there should be a way for web development to work.............. (i mean we do it already for our website now to access our current readers)

#

and we should be able to simulate devices from the example app I've riffled through already

loud latch
upbeat crown
#

how best should I try to verify javascript/typescript version?

#

this?

"node_modules/@babel/plugin-syntax-typescript": {
"version": "7.25.9",

loud latch
#

Can you share the stack trace for the error?

upbeat crown
#

right now, i am not using Android or iOS. I'm trying to test web at the moment

#

this is all i get:

Call Stack
factory (app/index.tsx:5)
Web Bundled 118ms node_modules/expo-router/_error.js (283 modules)

#

if I remove the import line, I do not get the error. The simple act of adding the import makes it break

loud latch
#

Neither of those are Stripe files.

#

What is the whole, complete error from the console, including all lines?

upbeat crown
#

Log 1 of 1
Server Error
Cannot read properties of undefined (reading 'getConstants')
Source

3 |

import
{
DarkTheme
,

NavigationContainer
,

ThemeProvider
}
from

'@react-navigation/native'
;

4 |

import
{ useRouter }
from

'expo-router'
;

5 |

import
{
Reader
,
requestNeededAndroidPermissions
,

StripeTerminalProvider
,
useStripeTerminal }
from

'@stripe/stripe-terminal-react-native'
;

|

^

6 |

7 |

import
{
AuthContext
}
from

'@/contexts/AuthContext'
;

8 |

import
{
AuthStackNavigator
}
from

'@/navigators/AuthStackNavigator'
;
Call Stack
factory
app/index.tsx:5
Showing all frames
This error cannot be dismissed.

loud latch
#

Ok cool. I don't recognize that format, but the call stack doesn't seem to include anything Stripe related at all.

upbeat crown
#

that may be the case, but I cannot use this on web testing under expo/metro. I don't have a device to test with or emulate. I'm trying to do this so I can get the flow done in a browser and worry about device testing at the end, and it is so frustrating that there's no easy way to do this without some device attached. I'm not at that stage yet

#

so any ideas?

loud latch
#

One sec.

upbeat crown
#

without the import line, i get this:

#

with the import line, i get this:

#

without the console active

rancid marshBOT
loud latch
#

Ahh, ok. Can you try four separate import lines like this?

import { Reader } from '@stripe/stripe-terminal-react-native';
import {  requestNeededAndroidPermissions } from '@stripe/stripe-terminal-react-native';
import { StripeTerminalProvider } from '@stripe/stripe-terminal-react-native';
import { useStripeTerminal } from '@stripe/stripe-terminal-react-native';

...and then see which line it's popping on?

upbeat crown
#

moment

#

stripeTerminalProvider

rancid marshBOT
ancient forum
#

Hi there! Taking over for timebox - just getting up to speed

upbeat crown
#

looks like it could be NativeModules not liking web testing, which doesn't make sense.

#

considering that the terminal SDK supports simulated readers and Internet-capable devices, it should not restrict web-based apps.

#

we use the terminal SDK on our current web-based system to interface with the BBPOS WisePOS E

#

we just wanted to be able to support the M2 with the new app

ancient forum
#

can you run cd ios && pod install?

This is a common issue with React Native SDK installation where sometimes pods required to run the app on iOS fail on the first try, but explicitly running the command afterwards reinstalls required packages

upbeat crown
#

not dealing with iOS yet. we were going to deal with Android first because i don't have a Mac yet

#

but i'm not testing with Android yet

#

just trying to use web testing without an emulator or device (frankly don't want to deal with compiles yet), so it's just Metro as a web server

#

and right now, i'm on Ubuntu desktop 24.04, so I don't have access to Apple tools

ancient forum
#

ah!

#

Terminal React Native SDK won't work on a web browser as it requires mobile specific APIs/features. You would need to test on an emulator

upbeat crown
#

and that will slow down my development time. seriously, does no one take into account that simulation is a thing and your sdk already supports internet-capable devices (we are already doing that now with our legacy app).

#

this is the reason i dislike the whole react native ecosystem

#

the rapid development for the UI was okay with web testing, but trying to do something serious now has to delay progress.

#

well, emulation does not work either.......

#

i get the same error

#

if i comment out the line, i get my screen as i'd expect

ancient forum
#

talking to a colleague with more expertise on React Native/terminal about this

upbeat crown
#

ok

faint crescent
#

Hello
Jumping in to help out

upbeat crown
#

where would i put the implementation lines? no context in the post

faint crescent
#

It says the file name right before the snippets?

#

build.gradle

#

should be undle android/ folder

upbeat crown
#

there's more than one.... ugh, looks like it's app/build.gradle

rancid marshBOT
upbeat crown
#

all i'm getting is a blank screen on the emulator...

#

weird

faint crescent
#

Hmm, are you seeing any errors/logs?

#

Try running adb logcat to see if the app just crashed or is still running?

upbeat crown
#

i have to break for about 45 minutes or so. need to head home from dialysis. any way to keep the ticket from getting closed?

faint crescent
#

We may close the thread after some inactivity. However, you can always open a new thread via #help