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

library not working in electron app #110

Open
SebastianBoehler opened this issue Mar 24, 2020 · 6 comments
Open

library not working in electron app #110

SebastianBoehler opened this issue Mar 24, 2020 · 6 comments

Comments

@SebastianBoehler
Copy link

SebastianBoehler commented Mar 24, 2020

The library works for me if I run my app via console but after packaging the electron app it wont anymore. Same for servers I am not able to run the library on servers.

@SebastianBoehler SebastianBoehler changed the title Package not working in electron app library not working in electron app Mar 24, 2020
@chill117
Copy link
Owner

Hello @YourSocialBot

This module uses puppeteer (runs a headless browser process) to scrape web pages. You will need to do some additional setup on your server(s) to make this module work:
https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-the-cloud

As for running from an electron app, that I have never tried. Please try to run your electron app with the following environment variable:

DEBUG=data-sourcer:error cmd-to-run-your-electron-app

Errors related to the browser/puppeteer usage should then be printed to the console.

@SebastianBoehler
Copy link
Author

Hey, thanks for the fast response!
How to set environment variables in electron? I have never worked with them.

@chill117
Copy link
Owner

@SebastianBoehler
Copy link
Author

This only works for me if I run the unpackaged app.
And the libary works in electron but after packaging the app it wont.

@chill117
Copy link
Owner

chill117 commented Mar 24, 2020

I think it is possible to set environment variables for the packaged app and then check the log files.

@mifi
Copy link

mifi commented Mar 25, 2020

FWIW there is a package puppeteer-in-electron which allows us to use an electron browser window in the running electron app as the puppeteer runner.

Not exactly the same, but I needed to run puppeteer in Electron and was able to solve it with that library. You can see how I solved it here:
https://github.com/mifi/SimpleInstaBot/blob/master/public/electron.js#L23

Maybe proxy-lists needs to pull puppeteer out as a peerDependency and accept the Page/Browser as an option for this to work however.

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

No branches or pull requests

3 participants