puppeteer-heroku-buildpack: TypeError: input.on is not a function

After following the directions, I’m seeing this error when puppeteer launches on heroku with the arguments mentioned and after installing the heroku puppeteer dependencies. Below is more of the error. Any ideas?

TypeError: input.on is not a function 2018-01-19T06:40:02.261833+00:00 app[web.1]: at new Interface (readline.js:181:11) 2018-01-19T06:40:02.261834+00:00 app[web.1]: at Object.createInterface (readline.js:64:10) 2018-01-19T06:40:02.261836+00:00 app[web.1]: at Promise (/app/node_modules/puppeteer/lib/Launcher.js:196:25) 2018-01-19T06:40:02.261837+00:00 app[web.1]: at new Promise (<anonymous>) 2018-01-19T06:40:02.261840+00:00 app[web.1]: at <anonymous> 2018-01-19T06:40:02.261837+00:00 app[web.1]: at waitForWSEndpoint (/app/node_modules/puppeteer/lib/Launcher.js:195:10) 2018-01-19T06:40:02.261838+00:00 app[web.1]: at Function.launch (/app/node_modules/puppeteer/lib/Launcher.js:133:39) 2018-01-19T06:40:02.944892+00:00 heroku[web.1]: Process exited with status 1 2018-01-19T06:40:02.807397+00:00 app[web.1]: events.js:183 2018-01-19T06:40:02.807407+00:00 app[web.1]: throw er; // Unhandled ‘error’ event 2018-01-19T06:40:02.807408+00:00 app[web.1]: ^ 2018-01-19T06:40:02.807409+00:00 app[web.1]: 2018-01-19T06:40:02.807411+00:00 app[web.1]: Error: spawn /app/node_modules/puppeteer/.local-chromium/linux-515411/chrome-linux/chrome EAGAIN 2018-01-19T06:40:02.807412+00:00 app[web.1]: at _errnoException (util.js:1024:11) 2018-01-19T06:40:02.807415+00:00 app[web.1]: at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) 2018-01-19T06:40:02.807416+00:00 app[web.1]: at onErrorNT (internal/child_process.js:372:16) 2018-01-19T06:40:02.807417+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:138:11) 2018-01-19T06:40:02.807418+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:180:9) 2018-01-19T06:40:02.831841+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2018-01-19T06:40:02.832193+00:00 app[web.1]: npm ERR! errno 1 2018-01-19T06:40:02.837169+00:00 app[web.1]: npm ERR! personal_project@2.0.0 start: node server.js 2018-01-19T06:40:02.837300+00:00 app[web.1]: npm ERR! Exit status 1 2018-01-19T06:40:02.837508+00:00 app[web.1]: npm ERR! 2018-01-19T06:40:02.837647+00:00 app[web.1]: npm ERR! Failed at the personal_project@2.0.0 start script. 2018-01-19T06:40:02.837778+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2018-01-19T06:40:02.852375+00:00 app[web.1]: 2018-01-19T06:40:02.852951+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2018-01-19T06:40:02.853286+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-01-19T06_40_02_839Z-debug.log 2018-01-19T06:40:02.961374+00:00 heroku[web.1]: State changed from up to crashed 2018-01-19T06:40:02.964058+00:00 heroku[web.1]: State changed from crashed to starting 2018-01-19T06:40:11.479178+00:00 heroku[web.1]: Starting process with command npm start

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 20 (8 by maintainers)

Most upvoted comments

I get the same error when bundling puppeteer-core and node-chromium with webpack:

TypeError: input.on is not a function
    at new Interface (readline.js:207:11)
    at Object.createInterface (readline.js:75:10)

This is reproducable!

@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.

@KengoTODA gonna be hard to say for sure what the cause was if we can’t repro it and then try things to resolve it. There are a couple other issues that had something similar but never got a for sure answer on what the cause was. My best guess was having headless: true since that breaks in heroku. If it comes back up you can feel free to open another issue, but the buildpack is for getting puppeteer running on heroku and so it is likely something unrelated to the buildpack specifically. Hope it doesn’t show up any more for you!