Skip to content
This repository has been archived by the owner on Jun 20, 2020. It is now read-only.

nick.exit() is killing the whole node.js #26

Closed
Benraay opened this issue Mar 22, 2018 · 2 comments
Closed

nick.exit() is killing the whole node.js #26

Benraay opened this issue Mar 22, 2018 · 2 comments

Comments

@Benraay
Copy link

Benraay commented Mar 22, 2018

Hi guys,

You made a great tool, but I'm running in an issue.

when I try the sample code in node.js when the code is reaching nick.exit(0); the whole node process is killed I was making some tests with postman and as a result the response from the server is always : "Could not get any response" but in the node logs I have :
"server started on: 3000"
"Tab 1: Navigation (open): http://:www.google.com"
"Process finished with exit code 0"
and after the node server is not responding and is killed.

I tried also on a remote server the node server is restarting but every time the process is killed.

For now I found a workaround "tab.close()" but it looks like the chrome is staying there in background and every time a new Nick is created a new chrome is launched.

Can you give me some advice about this or is it a bug ?

@paps
Copy link
Member

paps commented Mar 22, 2018

Hi, it's not a bug but a feature.

You can workaround this in two ways:

  • either keep Chrome running and call close() / newTab()
  • or kill Chrome (for example exec killall google-chrome), lose all references to Nick and instantiate a new Nick that will spawn a new Chrome again

I suggest the first solution because it's easier (if you don't mind having Chrome stay open on your server (beware of state/cookies being kept))

@paps paps closed this as completed Mar 22, 2018
@Benraay
Copy link
Author

Benraay commented Mar 22, 2018

thanks I will continue using open/closing tabs and sometimes kill chrome in order to keep memory usage low I saw this technique in phantomJS driving (maybe there are some memory leaks in it)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants