React native iOS running 1 of 1 custom shell scripts took long time - react-native-ios

When trying to debug react native app on device, it takes really long time when "running 1 of 1 custom shell scripts". It will not fail, but just take long time. Is there anybody know what process is this? And how can we shorten this time? Thank you!

I didn't solve this one, but I did find out some information. For me, it seems that this is happening because the script hangs for ~15-30 seconds after it has completed the bundle (and asset copy). This is one of those cases where the main thread in a node script has completed, and node is just waiting for a promise to resolve before it quits ... and it waits too long. I was able to mitigate the problem by adding a call to process.exit(0) in the right place within react/native/local-cli, to wit:
https://github.com/facebook/react-native/blob/master/local-cli/cliEntry.js:116 (popping a .then(()=>process.exit(0) onto the end of that line.
Not an elegant solution but maybe some others can pick it up from there.

I had the same problem (Mac/iOS) after updating react-native from 0.47.2 to 0.48.2.
Then I came across a solution from this link (I think this is what worked for me).
Anyway what I did was reinstall watchman as shown below:
brew uninstall watchman
brew install watchman
Hope this helped.

Related

No top-level getter '_registerPlugins' declared error

I get this error every 5 ~ 10 minutes while running my app.
My app doesn't stop or anything, but I think something needs to be done.
What is wrong and what should be done to avoid this error?
Some part of your code is calling registerPlugins, which is no longer needed... We need find out which package calls that and update it.

Running Selenium in container brings sudden selenium errors where there were none before

Whenever I run my tests on my computer, they work relatively fine. At the very least, selenium runs without problems.
As soon as I run the same tests on a docker container I start running in all kinds of errors that selenium started throwing, such as: "Element not clickable at point...", "Element is not interactable...", etc.
None of these happen when I run the tests on my computer normally.
I have a Linux Debian 9 computer, docker 1.11, Chrome 72.0, chromedriver 2.41, selenium 3.12. Test are done using py.test and in headless chrome.
My Dockerfile is simple, installing all of the packages for python and putting my tests in there and running them. I run a custom-made Dockerfile and don't have the option to use the premade seleniumHQ ones.
I have first tried running a demo test where I first encountered that problem. I managed to solve it by editing the test code to bypass the exception and trying again. After that succeeded, I tried running a few more complicated tests and kept running into different errors I didn't run into before.
Every solution I found was aimed at solving the thrown exception, but I suspect there's a deeper issue at hand and I can't figure out what it is.
To reiterate: running tests on my computer (both headless and otherwise) works like a charm, but running the same tests in a docker container fails with several selenium errors thrown. For some reason, the tests don't seem to run properly and selenium keeps throwing errors.
I've been trying to solve it for a while now and can't seem to figure out what the problem is.
I'd like to know WHY this problem occurs and how to solve the root cause of it. If it's a known issue and the solution is indeed simply to solve every exception as it comes, I'd like to know that too.
As far as I could find, and how I solved this, is to just follow the exceptions and fix them as they come.
The general problem areas I encountered were the click event on buttons/textbox and clearing the text from a textbox.
The solution involved:
A call to webdriver.execute_script('arguments[0].click();', element) to replace button click events.
A call to webdriver.execute_script('arguments[0].focus();', element) to replace textbox click events.
A call to webdriver.execute_script('arguments[0].value = "";', element) to replace textbox clears.
From where I stand, these solved most if not all the sudden exceptions and the rest worked as intended.
I have encountered similar problems when running Selenium with chromedriver, suddenly elements being unclickable, not visible on the page etc. The solution was to disable /dev/shm usage by adding --disable-dev-shm-usage to the Chrome arguments.

What does "Gdk-WARNING **: gdk-frame-clock: layout continuously requested, giving up after 4 tries" mean?

When I run the gtk3 python code using pygobject in Ubuntu 18.04, the code runs without any warnings. But when I build it on Ubuntu 16.04 for snap, I am getting these warnings:
Gdk-WARNING **: gdk-frame-clock: layout continuously requested, giving up after 4 tries
There is no part of the code that tries to refresh the screen even twice within a second(unless there is some check_resize events). I am unable to understand what is causing this error. I don't have a Ubuntu 16.04 with me. so I can't debug either.
Steps to reproduce
Install the edge release from the snap.
sudo snap install --edge halo-weather
and run it.
halo-weather
It's an opensource project of a simple weather application named Halo. Here is the entry point python script.
Can somebody give me some directions?
The error generally means you are directly trying to modify the UI out of sync with GTK thread.
So we need to make sure that all UI updating functions are not directly called and instead queued to be called by Gtk using any of the following:
GLib.idle_add(callback, ...)
GLib.timeout_add(interval, callback, ...) # X milliseconds delay
GLib.timeout_add_seconds(interval, callback, ...) # X seconds delay
Hope that will help someone.

Node hot reload

i wanted to implement an hot-reload feature in my app.
Basically when i change a file that returns a value i want it to be working on my running application.
This involves some require.cache knowledge that maybe i got wrong,
i've found a small repo that i thought it could help me with no chance.
The repo is clear-module and i prepared a small example on top of it
git clone git#bitbucket.org:giggioz/test-clear-module.git
install the modules with
npm i
and then run it with
node index.js
This code prints every 500ms a value.
This value comes from a delegate.
My Issue
If i change the value returned by get-points.js while the code is running it does not do anything... i would expect a change, right?
Thanks for your help!

Gulp task finishes but never ends

NOTE: Here is an example repo with the problem.
When I run ./gulp js, the process works (creates the expected files on the file system), but the task never completes... just hangs indefinitely:
ss http://zc.d.pr/4C9U/3GG90rpz+
I figure I'm not returning something somewhere, or invoking a callback correctly, but after hours of tinkering, head-banging, and Googling, I haven't found a solution.
Can someone help me out here?
If it makes a difference, I'm currently using node v4.1.0. All other dependencies and versions are in the example repo linked above.
EDIT: Original inspiration for this gulp recipe came from https://truongtx.me/2015/06/07/gulp-with-browserify-and-watchify-updated/
However, I couldn't get transform to work as that author suggested, which led me to https://github.com/substack/node-browserify/issues/1198#issuecomment-89948202
Of course—as it always happens—I think of something new to try just after I post to SO and it appears to work.
doh http://zc.d.pr/11uMa/5gghjbCx+
You can see my full changeset here: https://github.com/neezer/gulp-browserify-hanging-task/commit/8156e182c04c2e76c5739e31f5a6e417dda01b70
TL;DR Basically I tried the suggestion in the last comment on the aforementioned issue from my question, where I pass the file object itself to browserify instead of the file path, and lo-and-behold, the task finishes now.
I don't pretend to know why that fixed the issue, so if anyone would like to explain, I'd love to learn. ;)

Resources