Nested `runAsync` calls throw `ReferenceError: Property 'global' doesn't exist`
@chrfalch がすでに取り組んでいます。
2024年5月3日 から。
評価
この issue はまだ評価されていません。
説明
When using nested runAsync calls like so:
const context = Worklets.defaultContext
context.runAsync(() => {
'worklet'
console.log('first!')
Worklets.runOnJS(() => {
'worklet'
console.log('second!')
try {
const worklet = () => {
'worklet'
console.log('third!')
}
context.runAsync(worklet)
} catch (e) {
console.error(e)
}
})
})
The worklet creation throws an error:
- ERROR [ReferenceError: Property 'global' doesn't exist]
For some reason I couldn't reproduce this in this repo, but I can reproduce this 100% / always in react-native-vision-camera.
Funny thing is; this doesn't throw in context.runAsync(worklet), but rather in the const worklet = () => { ... } function creation.
Maybe it is a bug in the babel plugin?
I think we need two PRs related to this issue btw;
- Fixing the bug in the babel plugin to make sure this code works (hopefully this also fixes the bug where
runAsyncsometimes didn't run in release in VisionCamera Frame Processors) - Add a try / catch handler to properly display error messages in Worklets (otherwise errors just get swallowed)
- 主要言語
- C++
- スター
- 791
- フォーク
- 65
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
margelo/react-native-worklets-core のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
margelo/react-native-worklets-core#271 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
margelo/react-native-worklets-core#269 · リアクション 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
margelo/react-native-worklets-core#268 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
margelo/react-native-worklets-core#267 · コメント 1 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
margelo/react-native-worklets-core#266 · コメント 1 件 · リアクション 2 件 ·
margelo/react-native-worklets-core の issue をすべて見る
似ている issue
-
prio:medium status:idea type:feat
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
kind/bug needs-sig needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
drogonframework/drogon#2605 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
ArthurSonzogni/FTXUI#1363 ·