Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#186 3 comentarios 0 reacciones 1 asignado Ver en GitHub

@chrfalch ya está trabajando en esto.

Desde el 3/5/2024.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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)
Lenguaje dominante
C++
Estrellas
791
Forks
65
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de margelo/react-native-worklets-core

Todos los issues de margelo/react-native-worklets-core

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.