You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
I'm facing an issue while deploying a Python app on Heroku that utilizes Playwright to launch Chromium. Despite following best practices and ensuring the Chromium executable is present in the expected directory, I consistently receive an error stating that the "executable doesn't exist".
withsync_playwright() asp:
# Troubleshooting for local and Heroku builddefault_path="/app/.heroku/python/lib/python3.11/site-packages/playwright/driver/package/.local-browsers/chromium-1071/chrome-linux/chrome"chromium_path=os.getenv("PLAYWRIGHT_CHROMIUM_PATH", default_path)
browser=p.chromium.launch(
headless=True, # Set False for debugging and local devargs=['--no-sandbox'],
executable_path=chromium_path
)
# ... rest of code
Error Message playwright._impl._api_types.Error: Failed to launch chromium because executable doesn't exist at /app/.heroku/python/lib/python3.11/site-packages/playwright/driver/package/.local-browsers/chromium-1071/chrome-linux/chrome
However, running heroku run bash and verify presence of the executable using ls, I can clearly see the Chromium executable present at the mentioned path.
Steps Taken:
Verified the presence of the Chromium executable on the Heroku Dyno.
Ensured the Playwright buildpack is correctly set up and is first in the order.
Tried using different environment variables including PLAYWRIGHT_BROWSERS_PATH and PLAYWRIGHT_CHROMIUM_PATH.
Checked for any potential conflicts with Selenium (previously used in the project) and its associated environment variables.
Expected
Playwright should successfully launch Chromium without any errors.
Actual
Playwright consistently fails to launch Chromium with an error stating the executable doesn't exist, even though it's present in the directory.