Expo dependency error, "Cannot find native module 'ExpoCrypto'", in Non-Expo React Native Projects
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- react-native, typescript
- Bereich
- mobile
Rechercherichtung
Reproduziere den Fehler mit React Native 0.73.2, cloudinary-react-native 0.2.0 und dem im Issue beschriebenen Bare-Project-Setup. Untersuche zuerst package-lock.json und die Expo-bezogenen Abhängigkeiten des Pakets; abgeschlossen ist die Aufgabe, wenn das SDK entweder in einer reinen React-Native-App funktioniert oder den erforderlichen Workaround und das unterstützte Setup dokumentiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I encountered an issue while integrating the cloudinary-react-native package version 0.2.0 into my bare React Native project. The problem arises due to the package's dependency on ExpoCrypto and other Expo modules, which are not available in a non-Expo (bare) React Native environment.
Steps to Reproduce
- Create a new bare React Native project using npx react-native init MyProject.
- Install the cloudinary-react-native package using npm install cloudinary-react-native.
- Attempt to use the package according to the provided documentation.
- Encounter an error related to the missing ExpoCrypto module when running the app.
Expected Behavior
I expected that the cloudinary-react-native package could be used in a bare React Native project without dependencies on Expo-specific modules, or that there would be clear documentation on how to handle such dependencies in a non-Expo environment.
import {Cloudinary} from '@cloudinary/url-gen';
import {upload} from 'cloudinary-react-native';
async function uploadImageToCloudinarySDK(payload: any) {
const {folder, upload_preset, uri} = payload;
const cld = new Cloudinary({
cloud: {cloudName: Config.CLOUDINARY_CLOUD_NAME },
url: {secure: true},
});
const options = {folder, upload_preset, unsigned: true};
await upload(cld, {
file: uri,
options,
callback: (error: any, response: any) => {
if (error) {
console.error('Upload Error:', error);
} else {
console.log('Upload Successful:', response);
}
},
}).catch((error: any) => console.log('ERROR CLD UPLOAD', error?.message));
}
Actual Behavior
The application throws an error indicating that the ExpoCrypto native module cannot be found. This suggests that the package relies on Expo modules, which are not present in bare React Native environments. The exact error message is:
Cannot find native module 'ExpoCrypto', js engine: hermes
Environment
- React Native version: 0.73.2
- Cloudinary React Native SDK version: 0.2.0
- Operating System: iOS
- Device details: iPhone 15 Pro Max
Additional Context
I am not using Expo in my project and prefer to keep it as a bare React Native application. I noticed that the package-lock.json file lists several Expo-related dependencies, which might be causing this issue.
Given the package's potential utility for React Native developers looking to integrate Cloudinary, finding a solution to make it compatible with both Expo and non-Expo environments would be greatly beneficial.
Potential Solutions or Workarounds
I am seeking guidance on how to resolve this issue. Possible solutions could include:
- Instructions on how to remove or bypass the Expo dependencies in a non-Expo environment.
- Updates to the package to support bare React Native projects without requiring Expo modules.
- Any other recommended approaches for using cloudinary-react-native in non-Expo React Native projects.
Thank you for looking into this issue. I appreciate any feedback or solutions you can provide.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 28
- Forks
- 21
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cloudinary/cloudinary-react-native
-
hacktoberfest-accepted
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
cloudinary/cloudinary-react-native#55 · 3 Kommentare ·
-
Add CODE_OF_CONDUCT.mdEvtl. wieder frei @adimiz1 hat das vor 405 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary-react-native#53 · 2 Kommentare · 1 zugewiesene Person ·
-
Support for expo 54Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 45/100
cloudinary/cloudinary-react-native#52 · 8 Kommentare ·
-
Issue: Improve `bootstrap.js` to support both Yarn and NPM with clearer errorsEvtl. vergeben @adimiz1 hat das vor 415 Tagen übernommen. Offen
cloudinary/cloudinary-react-native#50 · 3 Kommentare · 1 zugewiesene Person ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
Alle Issues in cloudinary/cloudinary-react-native
Ähnliche Issues
-
area:docs documentation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 12 Tagen
-
area:docs good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
thainanluiz/TSSuper#30 ·
-
[analytics-core] getQueryParams does not decode `+` as space and truncates values containing `=`Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
amplitude/Amplitude-TypeScript#2179 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
ci good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
TMHSDigital/GH-Arcade#111 ·