SimonErm / react-native-job-queue

Easy to use react-native queuing library
https://simonerm.github.io/react-native-job-queue/
122 stars 33 forks source link

TypeError: Cannot read property 'addJob' of null, js engine: hermes #100

Open mrojas18 opened 11 months ago

mrojas18 commented 11 months ago

i'm getting this error: TypeError: Cannot read property 'addJob' of null, js engine: hermes

alfter running the example code:

`import queue from 'react-native-job-queue'

queue.configure({onQueueFinish:(executedJobs:Job[])=>{ console.log("Queue stopped and executed",executedJobs) }}); queue.addWorker(new Worker("testWorker",async(payload)=>{ return new Promise((resolve) => { setTimeout(() => { console.log(payload.text); resolve(); }, payload.delay);}); })) queue.addJob("testWorker",{text:"Job example palyoad content text",delay:5000})`

SimonErm commented 11 months ago

Can you provide more information? Which OS, which react-native version etc.?

mrojas18 commented 11 months ago

sorry: i'm using Android for test.

Enviroment: System: OS: Windows 11 10.0.22631 CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz Memory: 2.10 GB / 15.84 GB Binaries: Node: version: 20.10.0 path: C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: version: 10.2.3 path: C:\Program Files\nodejs\npm.CMD Watchman: version: 20231008.002904.0 path: C:\watchman\bin\watchman.EXE SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-223.8836.35.2231.11005911 Visual Studio:

SimonErm commented 11 months ago

I am not able to reproduce the error. Can you provide the full stacktrace?

WillyChristian commented 7 months ago

I was facing this issue, as described for the OP.

image

The problem seems to be located on jobStore, which should get the NativeModule values image

So then I linked the lib manually with npx react-native link react-native-job-queue. Hope this helps anyone else.

kevinmartin33 commented 3 weeks ago

I had the same issue on a fresh install on React Native 0.77 today, To fix that for me I just execute that rm -rf ~/Library/Developer/Xcode/DerivedData and relauch your Metro and new fresh build