DEV Community

Rikusen / りくせん
Rikusen / りくせん

Posted on

Deploy playwright on Heroku

I found a solution to use playwright on Heroku, since the playwright buildpack is outdated.

Note
This is for someone who is still getting below error even you installed buildpack to Heroku

╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
Enter fullscreen mode Exit fullscreen mode

In short,

Add these 2 buildpack (The order is really important, apt should be first):
Buildpacks

Add Aptfile at same as Procfile if you have one:

libgtk-3-0
libasound2
libxcomposite1
libxdamage1
libxfixes3
libxrandr2
libxtst6
libatk1.0-0
libdbus-glib-1-2
libwayland-server0
libx11-xcb1
libxcursor1
libxi6
Enter fullscreen mode Exit fullscreen mode

(Optional if you not already doing)
Add engines (package.json):

  "engines": {
    "node": "16.x",
    "yarn": "1.x" // Could be npm, choose for your environment
  },
Enter fullscreen mode Exit fullscreen mode

That's it.

Top comments (0)