{"id":13650912,"url":"https://github.com/playwright-community/heroku-playwright-buildpack","last_synced_at":"2025-04-22T18:33:23.039Z","repository":{"id":41347770,"uuid":"264465948","full_name":"playwright-community/heroku-playwright-buildpack","owner":"playwright-community","description":"Buildpack for running Playwright with Chromium and Firefox on Heroku.","archived":false,"fork":false,"pushed_at":"2024-01-19T21:29:41.000Z","size":12,"stargazers_count":44,"open_issues_count":11,"forks_count":42,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-01T17:23:45.484Z","etag":null,"topics":["chromium","firefox","heroku","playwright"],"latest_commit_sha":null,"homepage":"https://heroku.playwright.tech","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/playwright-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-05-16T15:23:06.000Z","updated_at":"2024-04-01T21:30:43.000Z","dependencies_parsed_at":"2024-04-15T07:12:19.787Z","dependency_job_id":"e0f846f0-6e5e-4135-a529-aed91d89fbde","html_url":"https://github.com/playwright-community/heroku-playwright-buildpack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fheroku-playwright-buildpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fheroku-playwright-buildpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fheroku-playwright-buildpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fheroku-playwright-buildpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playwright-community","download_url":"https://codeload.github.com/playwright-community/heroku-playwright-buildpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903251,"owners_count":17222502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chromium","firefox","heroku","playwright"],"created_at":"2024-08-02T02:00:42.460Z","updated_at":"2024-11-10T01:31:27.912Z","avatar_url":"https://github.com/playwright-community.png","language":"Shell","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"# Heroku Playwright Buildpack\n\nThis buildpack installs all the needed dependencies to use Playwright with Chromium and Firefox on Heroku.\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/mxschmitt/heroku-playwright-example)\n\n## Usage\n\nFor using this buildpack, you have to add the buildpack **before** installing your Node.js dependencies.\n\n```txt\nheroku buildpacks:set https://github.com/mxschmitt/heroku-playwright-buildpack.git -a my-app\n```\n\nFor a full example, see [here](https://github.com/mxschmitt/heroku-playwright-example) a usage with the Express library.\n\nIt's common to use the `PLAYWRIGHT_BUILDPACK_BROWSERS` environment variable which accepts a comma-separated list of the browser names (`chromium`, `firefox`, `webkit`). By default, it's installing the dependencies for all the browsers. To only install Chromium dependencies for example, just set it to `chromium`. This will reduce the slug size in the end too.\n\nYou should also install the browser specific NPM packages like `playwright-chromium.` to reduce the slug size.\n\n## Examples\n\n### Chromium\n\nFor using Chromium, it's **necessary** to use `chromiumSandbox: false` in the launch options, since on Heroku is no support for the Chromium sandbox.\n\n```javascript\nconst { chromium } = require(\"playwright-chromium\");\n\n(async () =\u003e {\n  const browser = await chromium.launch({ chromiumSandbox: false });\n  const context = await browser.newContext();\n  const page = await context.newPage();\n  await page.goto(\"http://whatsmyuseragent.org/\");\n  await page.screenshot({ path: `chromium.png` });\n  await browser.close();\n})();\n```\n\n### Firefox\n\nFor Firefox, you can refer to the official examples, no need to adjust any configurations.\n\n```javascript\nconst { firefox } = require(\"playwright-firefox\");\n\n(async () =\u003e {\n  const browser = await chromium.launch();\n  const context = await browser.newContext();\n  const page = await context.newPage();\n  await page.goto(\"http://whatsmyuseragent.org/\");\n  await page.screenshot({ path: `firefox.png` });\n  await browser.close();\n})();\n```\n\n## Best practises\n\nIt's common to only install the [browser-specific NPM packages](https://playwright.dev/#version=v1.1.1\u0026path=docs%2Finstallation.md\u0026q=download-single-browser-binary), which will reduce installation time and slug size on Heroku in the end, that should fix also the error that the slug size is too large.\n\nIf you encounter this error at runtime, it means that you are missing the chromium binary, which can be installed with `playwright install chromium`.\n\n```\nbrowserType.launch: Executable doesn't exist at /app/node_modules/playwright-core/.local-browsers/chromium-1012/chrome-linux/chrome\n╔═════════════════════════════════════════════════════════════════════════╗\n║ Looks like Playwright Test or Playwright was just installed or updated. ║\n║ Please run the following command to download new browsers:              ║\n║                                                                         ║\n║     npx playwright install                                              ║\n║                                                                         ║\n║ \u003c3 Playwright Team                                                      ║\n╚═════════════════════════════════════════════════════════════════════════╝\n```\n\nYou can incorporate this into Heroku's build step by including this script in `package.json`.\n\n```\n\"scripts\": {\n  \"heroku-cleanup\": \"yarn run playwright install [chromium | webkit | firefox]\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaywright-community%2Fheroku-playwright-buildpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaywright-community%2Fheroku-playwright-buildpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaywright-community%2Fheroku-playwright-buildpack/lists"}