-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Expo] Cannot find '../package.json' #291
Comments
Hmmm... Think this may be more of a fundamental problem with either the documentation/package itself. I started a new expo TS project and tried to integrate it. No cigar. I created a repo to replicate the error. You can find it here. https://github.com/ljc-codes/stripe-react-native-expo Looking forward to the response. |
Your repo is working fine for me on both a physical iOS device (Expo Go client v2.19.6): Can you try updating your expo clients and see if that resolves it? #3 (comment) |
@ljc-codes Try manually removing your |
Ah Interesting. Thanks guys this is helpful. It seems to work when I use an ios emulator aswell. apologies, was testing things out in the expo: web view. Cheers! |
React Native for Web is currently not supported |
Hi, @thorsten-stripe. Is there an estimate for support React Native for Web? |
Currently no plans. You would have to implement with Stripe Elements separately for the web platform target. |
I understand it doesn't work on web, and I don't have a problem with that. I know that there's a whole lot of considerations you have to make for a lib like this. However, some teams are targeting both Web and Native with react-native and Expo. To support this, we're using both the stripe-react-native lib, and stripe-js + react-stripe-js and building different components for each platform. The issue I'm seeing is that no matter what I try, it is still unable to resolve the I've tried:
Dynamic import, for example:
In every single case, it is still trying to resolve the stripe-react-native library, and causing a crash during web-compile (i.e. before launching the project in the browser) because it can't resolve the specific file. It's the only library I've ever seen this happen with. I know this may not be a bug specific to the library itself, but I feel most people are likely to head here to look for a solution. Can anyone shed some light on a solution? Is there something I can add to my Minor update (23:13 - 08 June 2021): I already tried using With that said, I would still like to see some fallback in the library to prevent this issue from happening if possible. |
@ChronSyn did you see https://github.com/stripe/stripe-react-native#requirements The SDK uses TypeScript features available in Babel version Any chance that helps resolve your errors? |
How to avoid this error:
|
Not sure if this is a bug or misconfiguration with my current loader / typescript configurations, But I get the following error every time I try to integrate stripe.
Module not found: Can't resolve '../../package.json' in '/Users/.../client/src/node_modules/@stripe/stripe-react-native/lib/module/components
Here's my tsconfig, webpack config and babel config respectively
The text was updated successfully, but these errors were encountered: