I have a react native expo project. Following the docs : https://docs.stripe.com/payments/accept-a-payment?platform=react-native&ui=payment-sheet
Importing ANYTHING from @stripe/stripe-react-native gives me the following error after a built:
`> ERROR TypeError: Cannot read property ‘getConstants’ of null, js engine: hermes
ERROR Invariant Violation: “main” has not been registered. This can happen if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error andAppRegistry.registerComponent
wasn’t called., js engine: hermes `
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { Provider } from "react-redux";
import store from "./redux/store";
import MainStack from "./components/navigation/MainStack";
//import { initStripe } from "@stripe/stripe-react-native"; Error
const client = new QueryClient();
export default function App() {
return (
<Provider store={store}>
<QueryClientProvider client={client}>
<MainStack />
</QueryClientProvider>
</Provider>
);
}
`
I’ve tried multiple cleanups and reccomendations (mostly from chatGPT) and nothing fixes it. Running it in a fresh expo project has no issues tho.
Noor Man is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.