Skip to content

Puppeteer needs environment variables set #264

@dreeves

Description

@dreeves

Desiderata

  • Clarify when/why setting these environment variables is needed (are both needed?)
  • Decide if we can make it happen automatically
  • Either do that or else document it in the README
  • If we want to be good citizens, improve the Stack Overflow answers that come up when you Google the error because currently they send you on wild goose chases

I'm not sure if this is specific to macOS with M1 chips or what but I currently have to do the following (HT Adam!) before running npm start for the Beebrain server (aka bbserver aka jsbrain_server):

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`

Replicata

  1. Take a fresh M1 mac
  2. Do all the things the README says to do, npm update, etc
  3. Go to the Beebrain server directory (jsbrain_server, which wants to be renamed to bbserver, btw)
  4. Run npm start

Expectata

$ npm start

> bbserver@2022.05.04 start
> PORT=8777 node jsbrain_server.js

Starting puppeteer with headless CHROME.
Started Puppeteer with pid 95325 and product chrome
(1): Initialized renderer.
(1): Listen port on localhost 8777.

Resultata

$ npm start

> bbserver@2021.03.16 start
> PORT=8777 node jsbrain_server.js

Starting puppeteer with headless CHROME.
Fail to initialze renderer. Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:412:11)
    at Object.spawn (node:child_process:698:9)
    at BrowserRunner.start ([...]road/jsbrain_server/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:95:34)
    at ChromeLauncher.launch ([...]road/jsbrain_server/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:113:16)
    at async create ([...]road/jsbrain_server/renderer.js:337:11) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}

Cognata

Verbata: dev env, headless chrome, opaque node errors, bbserver, local dev, apple silicon,

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGINFInfra, not user-visiblenix(closed as) wontfix or invalidzap(closed as) fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions