question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

worklet doesn't execute it's full body

See original GitHub issue

Description

According to my understanding this code https://gist.github.com/likern/7599926cdda1d4a5edd221a2630a44af should rerender component 1000 times.

And I have to see worklet: onFinish is called; index is 1000 in logs.

But, sometimes I see that worklet doesn’t work as expected.

It started executing and then suddenly just stops executing it’s body.

worklet: function start is the last log message. That means worklet started executing and then suddenly stopped at all.

[Tue Sep 01 2020 17:26:20.844]  LOG      [MeasureLayout] index [8], props: {"message":"8"}
[Tue Sep 01 2020 17:26:20.848]  LOG      useEffect: before runOnUI
[Tue Sep 01 2020 17:26:20.848]  LOG      useEffect: after runOnUI
[Tue Sep 01 2020 17:26:20.850]  LOG      worklet: function start

while in worklet code there is unconditional next console.log should be executed:

console.log('worklet: function start');
const onLayoutWasCalled = getIsOnLayoutCalled();
console.log(`worklet: onLayoutWasCalled is ${onLayoutWasCalled}`);

Steps To Reproduce

Reproducing code https://gist.github.com/likern/7599926cdda1d4a5edd221a2630a44af

Expected behavior

Worklet should always execute it’s full body.

Actual behavior

Worklet stops executing it’s body.

Package versions

  • React: 16.11.0
  • React Native: 0.62.2
  • React Native Reanimated: 2.0.0-alpha.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
terrysahaidakcommented, Sep 7, 2020

I’m pretty sure you guys are using different versions of Reanimated that’s why you have different results. @likern I would wait until alpha.6 is released or use the master branch (at least for iOS).

0reactions
likerncommented, Sep 15, 2020

@likern any update?

Will try today

Okay, thank you

I’ve run multiple times and couldn’t catch this bug again on 2.0.0-alpha.6. Everything is working as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Background audio processing using AudioWorklet - Web APIs
This article explains how to create an audio worklet processor and use it in a Web Audio application.
Read more >
TypeError: undefined is not an object (evaluating 'worklet ...
Got this error when using react native reanimated carousel. Anyone with a work around? I was trying to use react reanimated carousel but...
Read more >
Enter Audio Worklet - Chrome Developers
There are two problems in this design: the event handling is asynchronous by design, and the code execution happens on the main thread....
Read more >
Worklet: Change Local GPO + Security Options | Community
Hello All! ... The worklet is pretty straight forward and labeled. ... #Set Execution policy to allow for 3rd party modules
Read more >
11 Worklets - HTML Standard - WhatWG
Another important point about script-loading is that loaded scripts can be run in multiple WorkletGlobalScope s per Worklet , as discussed in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found