Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get wechaty up and running using phantomjs #60

Closed
cherry-geqi opened this issue Oct 24, 2016 · 14 comments
Closed

Can't get wechaty up and running using phantomjs #60

cherry-geqi opened this issue Oct 24, 2016 · 14 comments

Comments

@cherry-geqi
Copy link

I'm using the latest branch. While executing

WECHATY_HEAD=phantomjs ts-node example/ding-dong-bot.ts

it complains:

INFO Wechaty v#git[bdac338 BREAKING CHANGE: `room-join`/`room-leave`/`join`/`leave` events now only emit `contactList: Contact[]` as params. no `contact: Contact` anymore.] initializing...
WARN PuppetWebBrowser execute() exception: {"errorMessage":"Unexpected token ','","request":{"headers":{"Accept":"application/json; charset=ut
...
WARN PuppetWebBrowser driver() exception: no driver

Did I miss something?

@huan
Copy link
Member

huan commented Oct 24, 2016

Hi @cherry-geqi ,

you had run into issue #30 , please go there to have a look for the solution.

also, there has a probability, when phantomjs-prebuilt is not installed correctly, such as be interrupted when installation. My phantomjs-prebuilt directory size is about 44MB, if yours is far away less than me, delete it and re-install might help.

$ du -sh node_modules/phantomjs-prebuilt/
 44M    node_modules/phantomjs-prebuilt/

and due to #28 , I'm not sure whether phantomjs could work with wechaty v0.4.x & 0.5.x(master).

If you want to run wechaty now, I recommend you to use chrome head, because it's well tested and work without any problem.

good luck.

@huan huan added the bug label Oct 25, 2016
@huan
Copy link
Member

huan commented Nov 16, 2016

@cherry-geqi

Thank you for the PR of #97

Could you confirm the phantomjs HEAD will work for Wechaty after your PR?

huan added a commit that referenced this issue Nov 16, 2016
huan added a commit that referenced this issue Nov 17, 2016
convert wechaty-bro.js to plain old javascript syntax #60
@cherry-geqi
Copy link
Author

Yes, it works.

@huan
Copy link
Member

huan commented Nov 17, 2016

Awesome. I'll turn on the phantom head unit tests then.

Cheers!

@huan
Copy link
Member

huan commented Nov 17, 2016

Hi @cherry-geqi ,

I still had the issue with running the demo bot: WECHATY_LOG=silly WECHATY_HEAD=phantomjs npm run demo, it can show the QR Code right. But after I scanned, it keeps showing the error: VERB PuppetWebEvent onServerLogin: browser not full loaded(15), retry later.

Could you try to run the above command for me to confirm whether it's ok at your side?

Appreciate.

@huan
Copy link
Member

huan commented Nov 18, 2016

Hi, @cherry-geqi ,

Could you please have a check for me for the demo bot? I need your help.

BTW, as you are reading the WechatyBro source code, you might be interested in this repository: webwxApp source code update tracker: https://github.com/wechaty/webwx-app-tracker/commits/master/formatted/webwxApp.js , just FYI.

@cherry-geqi
Copy link
Author

OK, I'll check this late today.

@cherry-geqi
Copy link
Author

cherry-geqi commented Nov 29, 2016

Sometimes phantomjs sends webwxnewloginpage request but gets no response. When this happens, wechaty keeps logging VERB PuppetWebEvent onServerLogin: browser not full loaded(15), retry later. Right now I have no idea why the server sometimes responses and sometimes don't. I have even added some custom headers and changed userAgent to Chrome to emulate the behavior of Chrome but no luck.

Here are the snapshots:
phantomjs:
36f146ad-472e-4a46-a3e9-167397ce63f0

chrome:
8497a1ef-4a12-482b-9000-be0f3c5b88ea

@huan
Copy link
Member

huan commented Nov 29, 2016

@cherry-geqi thanks for the information about phantomjs. It seems we need to dig deeper for it.

According to your post, did you mean when you are using WECHATY_HEAD=phantomjs, sometimes it works and sometimes not? If so, what's the success rate of your test? for example, will get X success after retry 10 times?

@cherry-geqi
Copy link
Author

Yes, about half-half, don't see clear regularities.

@huan
Copy link
Member

huan commented Nov 29, 2016

So how did you use Wechaty now? It seems you were using phantomjs before/now, but if it had this kind of problem, how can you deal with that?

Or you are using chrome/Docker now?

@huan
Copy link
Member

huan commented Apr 17, 2017

Hello, @cherry-geqi!

Long time no sees. I'd like to invite you to join the Chatie/Contributor Team because you are one of the early committers of Wechaty. :)

Did you receive my team invitation? I can resend an invitation to you if needed.

Thanks!

@huan
Copy link
Member

huan commented Jul 6, 2017

It seems phantomjs worked again by referring to #633

However it seems has some bugs like WebSocket connection is not stable, need to investigate more time to fix.

@huan
Copy link
Member

huan commented Jul 15, 2017

Close this issue because there are 2 users use it and it seems works like a charm.

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

No branches or pull requests

2 participants