Dynamic `import()` of a Node-API addon doesn't work on Android
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- android, babel, react-native, typescript
- 領域
- build-system, mobile
調査の方向性
apps/test-app/App.tsx の TODO から始め、Android での動的 import の失敗を再現し、それが reject するのか throw するのか、またそのメッセージを記録してください。次に packages/host/src/node/babel-plugin/plugin.ts を調べ、require() と import() の処理を比較してください。完了条件は、Android で動的 import が動作するか、または制限とその原因が、eslint-disable の意味のある説明を含めて文書化されていることです。
索引モデルが issue の本文から書いたものです。
説明
Tracking the TODO in apps/test-app/App.tsx.
The ferric-example test has to use require() — with an ESLint disable for @typescript-eslint/no-require-imports — because a dynamic import() of the same addon does not work on Android:
Nobody has established why. It matters beyond the test app: consumers writing modern ESM will reach for await import("some-addon") first, and if that silently fails on Android while working on iOS, it is a confusing first-run experience for exactly the audience this project targets.
Worth checking, roughly in order of likelihood:
- Whether the Babel plugin in
packages/host/src/node/babel-plugin/plugin.tsrewritesrequire("./addon.node")but leavesimport("./addon.node")untransformed — the plugin matchesrequirecall expressions, so a dynamic import may simply never be turned into arequireNodeAddon()call. - Whether Metro's async-import handling on Android (inline requires / RAM bundles) defers the module in a way that breaks the TurboModule lookup.
- Whether the failure is a rejected promise or a hard error, and what it actually says — the current comment records the symptom without the message.
Outcome should be either a fix (most likely: handle import() in the Babel plugin alongside require()) or a documented limitation, so the eslint-disable can carry a real explanation instead of an open question.
- 主要言語
- TypeScript
- スター
- 188
- フォーク
- 10
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 3
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstackincubator/react-native-node-api のほかの issue
-
Android 🤖
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projects オープンAndroid 🤖 good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
callstackincubator/react-native-node-api#163 · コメント 1 件 ·
-
enhancement good first issue gyp-to-cmake
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
callstackincubator/react-native-node-api#161 · コメント 3 件 · リアクション 1 件 ·
-
enhancement Host 🏡
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Automatable good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 15/100
callstackincubator/react-native-node-api#424 · コメント 1 件 ·
callstackincubator/react-native-node-api の issue をすべて見る
似ている issue
-
S: triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
snapshot-labs/stamp#666 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
GauravKarakoti/SecureFlow#1070 · コメント 1 件 ·
-
feature:Languages/Translations good first issue ready Web
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
digitalfabrik/integreat-app#4394 ·