Expo dependency error, "Cannot find native module 'ExpoCrypto'", in Non-Expo React Native Projects
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react-native, typescript
- 領域
- mobile
調査の方向性
React Native 0.73.2、cloudinary-react-native 0.2.0、および issue に記載されている bare project のセットアップで失敗を再現します。まず package-lock.json とパッケージの Expo 関連の依存関係を調査してください。SDK が bare React Native アプリで動作するか、必要な workaround とサポート対象のセットアップを文書化できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 28
- フォーク
- 21
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudinary/cloudinary-react-native のほかの issue
-
hacktoberfest-accepted
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cloudinary/cloudinary-react-native#55 · コメント 3 件 ·
-
Add CODE_OF_CONDUCT.md再び着手できるかも @adimiz1 が 405 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
cloudinary/cloudinary-react-native#53 · コメント 2 件 · 担当者 1 名 ·
-
Support for expo 54オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
cloudinary/cloudinary-react-native#52 · コメント 8 件 ·
-
Issue: Improve `bootstrap.js` to support both Yarn and NPM with clearer errors対応中かも @adimiz1 が 415 日前に担当しました。 オープン
cloudinary/cloudinary-react-native#50 · コメント 3 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
cloudinary/cloudinary-react-native の issue をすべて見る
似ている issue
-
area:docs documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 12 日以内に返信
-
area:docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
thainanluiz/TSSuper#30 ·
-
[analytics-core] getQueryParams does not decode `+` as space and truncates values containing `=`オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
amplitude/Amplitude-TypeScript#2179 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
ci good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TMHSDigital/GH-Arcade#111 ·