Nested `runAsync` calls throw `ReferenceError: Property 'global' doesn't exist`
@chrfalch ci sta già lavorando.
Dal 3/5/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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)
- Lingua principale
- C++
- Stelle
- 791
- Fork
- 65
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di margelo/react-native-worklets-core
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
margelo/react-native-worklets-core#271 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
margelo/react-native-worklets-core#269 · 2 reazioni ·
-
Unable to download JS bundleAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
margelo/react-native-worklets-core#268 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
margelo/react-native-worklets-core#267 · 1 commento · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
margelo/react-native-worklets-core#266 · 1 commento · 2 reazioni ·
Tutte le issue di margelo/react-native-worklets-core
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
KhronosGroup/Vulkan-Tutorial#524 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
microsoft/onnxruntime-genai#2633 ·
I maintainer di solito rispondono entro 1 giorno
-
mapper bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
firebase/firebase-ios-sdk#16718 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
tesseract-ocr/tesseract#4627 ·