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.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay