Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Nested `runAsync` calls throw `ReferenceError: Property 'global' doesn't exist`

オープン
#186 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@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;

  1. Fixing the bug in the babel plugin to make sure this code works (hopefully this also fixes the bug where runAsync sometimes didn't run in release in VisionCamera Frame Processors)
  2. Add a try / catch handler to properly display error messages in Worklets (otherwise errors just get swallowed)
主要言語
C++
スター
791
フォーク
65
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

margelo/react-native-worklets-core のほかの issue

margelo/react-native-worklets-core の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。