profile
viewpoint

jontewks/genetic-route-planner 3

Genetic algorithm to plan the best possible route between many places

jontewks/indeed-firebase 1

Created to show someone how to query indeed for job data then store the responses in firebase

BuildingConnected/intercom-node 0

Node.js bindings for the Intercom API

jontewks/bc-slack-alerts 0

Send alerts to BC Slack

jontewks/bootstrap 0

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

issue closedjontewks/puppeteer-heroku-buildpack

[Heroku] Compiled slug size is too large

The puppeteer buildpack was removed from my instance and I only found out trying to generate a PDF. Now I am trying to redeploy with ruby, node, and puppeteer and the slug is exceeding the limit of 500Mb by 124.7Mb :(

I wonder if there is an alternative to deploy the necessary binaries for puppeteer or reduce the size of the heroku/ruby buildpack!

Any other information needed? Stack is heroku-18

closed time in an hour

etozzato

issue commentjontewks/puppeteer-heroku-buildpack

[Heroku] Compiled slug size is too large

Hey @etozzato

One thing that might be worth trying would be this: https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache

I've also run into size issues on heroku when I really shouldn't have been, and starting a new app and adding the same buildpacks and code lowered the slug size, so that might be a second thing to try if the first doesn't work.

May also try the other command listed here for git cleanup: https://thoughtbot.com/blog/how-to-reduce-a-large-heroku-compiled-slug-size.

If none of those work, you may want to see if it is possible for you to deploy puppeteer in this case with just one language, ruby or node, instead of both.

Hope something here is helpful!

etozzato

comment created time in an hour

issue closedjontewks/puppeteer-heroku-buildpack

Error: Failed to launch the browser process! on a Heroku~like PaaS

Hi, and thanks for the buildpack!

I hope it's not inappropriate for me to create this issue, as my issue is not directly related to Heroku. I have forked this repo to make it compatible with Scalingo, a PaaS provider that works in a very similar fashion to Heroku.

The deployment works fine using that buildpack and their node buildpack, however it crashes when trying to launch a headless chrome using

const browser = await puppeteer.launch({ args:  ['--no-sandbox', '--disable-setuid-sandbox'] });

I get this error

Error: Failed to launch the browser process!
[0924/183844.745281:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[0924/183844.772930:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[0924/183844.796928:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[0924/183844.772960:FATAL:media_stream_manager.cc(743)] Check failed: video_capture_thread_->Start(). 
#0 0x559e00337239 base::debug::CollectStackTrace()
#1 0x559e002b30f3 base::debug::StackTrace::StackTrace()
#2 0x559e002c3d70 logging::LogMessage::~LogMessage()
#3 0x559e002c465e logging::LogMessage::~LogMessage()
#4 0x559dfe835494 content::MediaStreamManager::MediaStreamManager()
#5 0x559dfe835183 content::MediaStreamManager::MediaStreamManager()
#6 0x559dfe5469d1 content::BrowserMainLoop::BrowserThreadsStarted()
#7 0x559dfe961943 content::StartupTaskRunner::RunAllTasksNow()
#8 0x559dfe545fe5 content::BrowserMainLoop::CreateStartupTasks()
#9 0x559dfe5490f7 content::BrowserMainRunnerImpl::Initialize()
#10 0x559e04c14b6c headless::HeadlessContentMainDelegate::RunProcess()
#11 0x559dffe73e11 content::ContentMainRunnerImpl::RunServiceManager()
#12 0x559dffe738de content::ContentMainRunnerImpl::Run()
#13 0x559dffed4689 service_manager::Main()
#14 0x559dffe71a61 content::ContentMain()
#15 0x559dffed38cd headless::(anonymous namespace)::RunContentMain()
#16 0x559dffed35cc headless::HeadlessShellMain()
#17 0x559dfd7a7427 ChromeMain
#18 0x7f1f5b536b97 __libc_start_main
#19 0x559dfd7a726a _start

Received signal 6
#0 0x559e00337239 base::debug::CollectStackTrace()
#1 0x559e002b30f3 base::debug::StackTrace::StackTrace()
#2 0x559e00336dd5 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f1f61bcb890 (/lib/x86_64-linux-gnu/libpthread-2.27.so+0x1288f)
#4 0x7f1f5b553e97 gsignal
#5 0x7f1f5b555801 abort
#6 0x559e00335d35 base::debug::BreakDebugger()
#7 0x559e002c4210 logging::LogMessage::~LogMessage()
#8 0x559e002c465e logging::LogMessage::~LogMessage()
#9 0x559dfe835494 content::MediaStreamManager::MediaStreamManager()
#10 0x559dfe835183 content::MediaStreamManager::MediaStreamManager()
#11 0x559dfe5469d1 content::BrowserMainLoop::BrowserThreadsStarted()
#12 0x559dfe961943 content::StartupTaskRunner::RunAllTasksNow()
#13 0x559dfe545fe5 content::BrowserMainLoop::CreateStartupTasks()
#14 0x559dfe5490f7 content::BrowserMainRunnerImpl::Initialize()
#15 0x559e04c14b6c headless::HeadlessContentMainDelegate::RunProcess()
#16 0x559dffe73e11 content::ContentMainRunnerImpl::RunServiceManager()
#17 0x559dffe738de content::ContentMainRunnerImpl::Run()
#18 0x559dffed4689 service_manager::Main()
#19 0x559dffe71a61 content::ContentMain()
#20 0x559dffed38cd headless::(anonymous namespace)::RunContentMain()
#21 0x559dffed35cc headless::HeadlessShellMain()
#22 0x559dfd7a7427 ChromeMain
#23 0x7f1f5b536b97 __libc_start_main
#24 0x559dfd7a726a _start
  r8: 0000000000000000  r9: 00007fff47404d40 r10: 0000000000000008 r11: 0000000000000246
 r12: 00003ef3d943eb40 r13: 00007fff47404fa0 r14: 00003ef3d943eb50 r15: aaaaaaaaaaaaaaaa
  di: 0000000000000002  si: 00007fff47404d40  bp: 00007fff47404f90  bx: 00007fff474057d4
  dx: 0000000000000000  ax: 0000000000000000  cx: 00007f1f5b553e97  sp: 00007fff47404d40
  ip: 00007f1f5b553e97 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at Interface.<anonymous> (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
    at Interface.emit (events.js:327:22)
    at Interface.EventEmitter.emit (domain.js:483:12)
    at Interface.close (readline.js:416:8)
    at Socket.onend (readline.js:194:10)
    at Socket.emit (events.js:327:22)
    at Socket.EventEmitter.emit (domain.js:483:12)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Maybe you've encountered a similar issue before?

If that's of any use, I've also tried using an APT buildpack to install directly all the dependencies.

Environment:

closed time in an hour

7hibault

issue commentjontewks/puppeteer-heroku-buildpack

Error: Failed to launch the browser process! on a Heroku~like PaaS

Hey @7hibault. I have never run into this sort of issue before. The buildpack installs required dependencies, so if the error was a missing library, that would be easy to resolve. But this error is about connecting to a bus and socket, which is more OS level interactions rather than dependencies for puppeteer. I'm guessing thats the difference between scalingo and local/heroku, but having never used scalingo its hard for me to say. Perhaps a good place to start is to see if they have any official chromium buildpack, which is what I started with from heroku to get the puppeteer one up and running.

7hibault

comment created time in an hour

issue commentjontewks/puppeteer-heroku-buildpack

Error with saving screenshots

Hey @oihamza,

This buildpack is just to get puppeteer running on heroku, but doesn't have any effect on how it works after its running, so I don't believe this buildpack is responsible for issues saving screenshots.

One thought that did occur to me though, is that heroku may have different file permissions regarding overwriting existing files than your local computer does. Have you tried running it on heroku but not overwriting the previous screenshot each time, and instead giving each new screenshot a unique name? That probably wouldn't be ideal for the long run as you'll load up on storage space, but that would at least tell you if that was the problem or not.

Good luck!

oihamza

comment created time in 12 days

issue closedjontewks/puppeteer-heroku-buildpack

Error with saving screenshots

Thanks for creating this awesome buildpack!

I'm having so many issues with saving my screenshots from Puppeteer in Heroku and I'm on the verge of just giving up... I've combed through all the issues here and can't seem to find anything related, so I'm not sure if it's related to this buildpack or Puppeteer and Heroku in general.

Basically, I'm trying to take a screenshot so I can Tweet it, and I've created a bot that will Tweet regularly.

Everything works perfectly on my local machine, and each time I run my script Puppeteer overwrites the existing image path (as expected). However, when I deploy to Heroku, the image doesn't seem to save at all. I've tried formatting my script a number of ways (will post below), but none of the things seem to work. The bot still Tweets a random phrase as normal, but it's always the same image each time which leads me to believe Puppeteer isn't running properly.

Here are the different scripts that I've tried:

const puppeteer = require('puppeteer')

const takeScreenshot = async() => {
  const browser = await puppeteer.launch(
    {args: [
      '--no-sandbox',
      '--disable-setuid-sandbox',
    ],
  });
  const page = await browser.newPage();
  await page.setViewport({
      width: 720,
      height: 720,
      deviceScaleFactor: 1,
  });
  await page.goto('https://google.com');
  await page.screenshot({path: 'option/folder/screenshot.png'});
  await browser.close();
}

takeScreenshot();
const puppeteer = require('puppeteer')

const options = {path: 'option/folder/screenshot.png',}
const takeScreenshot = (async() => {
	const browser = await puppeteer.launch({
    headless: true,
    args: [
      '--no-sandbox',
      '--disable-setuid-sandbox',
    ]
	});
	try {
		const page = await browser.newPage();
		console.log("here")
		await page.setViewport({
			width: 720,
			height: 720,
			deviceScaleFactor: 1,
		});
		await page.goto('https://google.com');
		console.log("on this site")
		await page.screenshot(options)
    console.log("saved image")
	} catch (err) {
		console.error(err, err.message);
	} finally {
    await browser.close();
	}
});

takeScreenshot();

My heroku buildpacks are in the following order: Screen Shot 2020-09-15 at 11 57 42 PM

Do you know how I can make sure my Puppeteer screenshots save? Any help is appreciated! 😄

closed time in 12 days

oihamza

issue commentjontewks/puppeteer-heroku-buildpack

TypeError: input.on is not a function

@cakemountain thanks a lot for that extra info!

Yeah the package size does suck. I don't fully understand how it works on heroku's end, but even after clearing all the cache I could find, my slug size was stuck at an amount larger than the max allowed, but starting a new project with the same code resulted in a lower slug size. Thought I'd also mention that here just in case someone runs into that in the future.

As far as the package bloat goes, I think there are some here that aren't necessary as this was written to allow some of the other deprecated heroku stacks to run as well. Perhaps making some new versions only work with the newer stacks would be a help.

junca8

comment created time in 14 days

issue commentjontewks/puppeteer-heroku-buildpack

TypeError: input.on is not a function

@cakemountain hey, no no updates from me. This buildpack is only to get puppeteer running on heroku. All it does is get the necessary packages downloaded and available for chromium to run correctly. So I don't believe an issue that arises after chromium is running would be due to this buildpack.

junca8

comment created time in 14 days

PublicEvent
PublicEvent

issue closedjontewks/puppeteer-heroku-buildpack

Error: Cannot find module './common'

I'm getting the following error when trying to run puppeteer on Heroku using this buildpack.

internal/modules/cjs/loader.js:969 throw err; ^

Error: Cannot find module './common'Require stack:

  • /app/node_modules/debug/src/node.js
  • /app/node_modules/debug/src/index.js
  • /app/node_modules/puppeteer/lib/helper.js
  • /app/node_modules/puppeteer/lib/Browser.js
  • /app/node_modules/puppeteer/lib/api.js
  • /app/node_modules/puppeteer/lib/index.js
  • /app/node_modules/puppeteer/index.js ...

closed time in 3 months

emptypixels

issue commentjontewks/puppeteer-heroku-buildpack

Error: Cannot find module './common'

Other than that all I can guess at is to try the newest version of puppeteer, or if thats what you have, one version prior. If thats no good then next step I'd think would be to open an issue on the puppeteer repo as I don't believe this buildpack could cause your npm install to work incorrectly. Perhaps also give a shot to running puppeteer's example code which is very simple, and then seeing if that works which could tell you if its your specific code or something deeper. Just throwing ideas out which you may have already tried, but either way good luck getting to the root!

emptypixels

comment created time in 3 months

issue closedjontewks/puppeteer-heroku-buildpack

It seems that buildpack doesn't support browser.wsEndpoint()

I am getting error when trying to connect to endpoint generated by wsEndpoint() function, any ideas to fix this problem? P.S It works very fine on local

Error: Exactly one of browserWSEndpoint, browserURL or transport must be passed to puppeteer.connect

2020-06-07T18:23:01.370595+00:00 app[web.1]:     at Object.assert (/app/node_modules/puppeteer/lib/helper.js:51:15)

2020-06-07T18:23:01.370596+00:00 app[web.1]:     at ChromeLauncher.connect (/app/node_modules/puppeteer/lib/Launcher.js:158:18)

2020-06-07T18:23:01.370597+00:00 app[web.1]:     at Puppeteer.connect (/app/node_modules/puppeteer/lib/Puppeteer.js:63:31)

2020-06-07T18:23:01.370598+00:00 app[web.1]:     at scrap (/app/__sapper__/build/server/server.js:109:37)

2020-06-07T18:23:01.370599+00:00 app[web.1]:     at get$1 (/app/__sapper__/build/server/server.js:242:24)

2020-06-07T18:23:01.370599+00:00 app[web.1]:     at handle_route (/app/__sapper__/build/server/server.js:1995:11)

2020-06-07T18:23:01.370600+00:00 app[web.1]:     at Array.find_route (/app/__sapper__/build/server/server.js:2009:5)

2020-06-07T18:23:01.370600+00:00 app[web.1]:     at nth_handler (/app/__sapper__/build/server/server.js:4491:14)

2020-06-07T18:23:01.370600+00:00 app[web.1]:     at /app/__sapper__/build/server/server.js:4491:31

2020-06-07T18:23:01.370601+00:00 app[web.1]:     at Array.<anonymous> (/app/__sapper__/build/server/server.js:4541:4)

2020-06-07T18:23:01.370601+00:00 app[web.1]:     at nth_handler (/app/__sapper__/build/server/server.js:4491:14)

2020-06-07T18:23:01.370602+00:00 app[web.1]:     at /app/__sapper__/build/server/server.js:4491:31

2020-06-07T18:23:01.370622+00:00 app[web.1]:     at Array.<anonymous> (/app/__sapper__/build/server/server.js:4541:4)

2020-06-07T18:23:01.370622+00:00 app[web.1]:     at nth_handler (/app/__sapper__/build/server/server.js:4491:14)

2020-06-07T18:23:01.370623+00:00 app[web.1]:     at /app/__sapper__/build/server/server.js:4491:31

2020-06-07T18:23:01.370623+00:00 app[web.1]:     at Array.<anonymous> (/app/__sapper__/build/server/server.js:4459:4)

closed time in 3 months

iwazowsky

issue commentjontewks/puppeteer-heroku-buildpack

Error: Cannot find module './common'

Whoops sorry for the slow response.

Haven't seen this issue before and from the stack trace there it appears to be something up with the puppeteer installation. Have you tried deleting the build cache on heroku and starting fresh? That would be my first guess. https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache

emptypixels

comment created time in 3 months

more