Error when trying to register headless task in library
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, react-native
- 領域
- mobile-dev, tooling
調査の方向性
まず、リンクされた repro から問題を再現し、example/index.js の AppRegistry の結果をライブラリ wrapper の結果と比較します。create-react-native-library の turbo-module setup が React Native をどのように解決するかを調べ、その後、重複した React Native インスタンスなしでライブラリ経由の headless タスク登録が機能することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
Hi!
I'm trying to create a wrapper around the AppRegistry.registerHeadlessTask function in my library like this:
export function setBackgroundMessageHandler(handler: BackgroundMessageHandler) {
AppRegistry.registerHeadlessTask('MediaControlsHeadlessTask', () => handler);
}
And this is in the example/index,js:
setBackgroundMessageHandler(require('./src/handler'));
This results in the following errors:
E Invariant Violation: "MediaControlsExample" 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, and `AppRegistry.registerComponent` wasn't called., js engine: hermes
E ExceptionsManager should be set up after React DevTools to avoid console.error arguments mutation
E TypeError: property is not writable, js engine: hermes
E TypeError: Cannot read property 'default' of undefined, js engine: hermes
Calling AppRegistry.registerHeadlessTask in the example/index.js directly works. It seems like AppRegistry points to two react-native instances?! E.g. when printing AppRegistry.getAppKeys(), I get different results in the example/index.js and the library.
Packages
- create-react-native-library
- react-native-builder-bob
Selected options
"create-react-native-library": {
"languages": "kotlin-objc",
"type": "turbo-module",
"version": "0.52.0"
}
Link to repro
https://github.com/mbpictures/react-native-media-notification/tree/feat/android-auto-library
Environment
info Fetching system and libraries information...
System:
OS: Windows 11 10.0.26100
CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700K
Memory: 3.77 GB / 31.77 GB
Binaries:
Node:
version: 22.16.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 3.6.1
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 8.12.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Enabled
AllowDevelopmentWithoutDevLicense: Enabled
Versions:
- 10.0.19041.0
- 10.0.22000.0
IDEs:
Android Studio: Not Found
Visual Studio:
- 16.11.35026.282 (Visual Studio Community 2019)
- 17.10.35122.118 (Visual Studio Community 2022)
Languages:
Java: 17.0.9
Ruby:
version: 3.2.3
path: C:\Ruby32-x64\bin\ruby.EXE
npmPackages:
"@react-native-community/cli":
installed: 18.0.0
wanted: 18.0.0
react:
installed: 19.0.0
wanted: 19.0.0
react-native:
installed: 0.79.2
wanted: 0.79.2
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
info React Native v0.81.0 is now available (your project is running on v0.79.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.81.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.2&to=0.81.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".
- 主要言語
- JavaScript
- スター
- 3.2k
- フォーク
- 227
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstack/react-native-builder-bob のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
callstack/react-native-builder-bob#901 · コメント 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
callstack/react-native-builder-bob#896 · コメント 2 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
callstack/react-native-builder-bob#852 · コメント 1 件 · リアクション 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
callstack/react-native-builder-bob#829 · コメント 20 件 ·
callstack/react-native-builder-bob の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
daisy/a11y-meta-viewer#18 ·
-
good first issue status: needs triaging type: bug version: 2.0
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
medusajs/medusa#17094 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
browser: chrome package: @carbon/react package: styles
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
carbon-design-system/carbon#23567 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
clerk/javascript#10033 ·
メンテナーはふだん 1 日以内に返信
-
bug client p1
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信