Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't working properly on Heroku #17

Open
matheuschimelli opened this issue Feb 27, 2022 · 12 comments
Open

Doesn't working properly on Heroku #17

matheuschimelli opened this issue Feb 27, 2022 · 12 comments

Comments

@matheuschimelli
Copy link

First I would like to thank you for this buildback.

I would like to report a bug that i found when i was trying to deploy the heroku-playwright-buildback.
Some important infos:

  • Node v17.6.0
  • Npm v8.5.1
  • Running on Heroku
    I'm using Typescript as well.

What's happening is that when i deploy heroku-playwright-buildback it doensn't work. However when i use the puppeteer buildpack https://github.com/jontewks/puppeteer-heroku-buildpack.git my app works.

I'm suspecting there is a bug but I don't know where it is.

browserType.launch: Executable doesn't exist at /app/node_modules/playwright-chromium/node_modules/playwright-core/.local-browsers/chromium-973391/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ 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                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
    at playwrightCrawler (/app/dist/lib/crawler-base.js:12:58)
    at default_1 (/app/dist/jobs/crawlers/crawler-tjpr-diary/sandbox.js:11:97)
    at processor (/app/node_modules/bull/lib/process/master.js:69:50)
    at /app/node_modules/bull/lib/process/master.js:91:33
    at process.<anonymous> (/app/node_modules/bull/lib/process/master.js:109:9)
    at processEmit [as emit] (/app/node_modules/signal-exit/index.js:175:34)
@bauerjon
Copy link

Same issue here. @matheuschimelli are you using yarn? i found that the demo broke when using yarn as that is what we are trying to get to work on our end.

@mxschmitt any thoughts on how to get the demo/buildpack to work with yarn?

@matheuschimelli
Copy link
Author

Same issue here. @matheuschimelli are you using yarn? i found that the demo broke when using yarn as that is what we are trying to get to work on our end.

@mxschmitt any thoughts on how to get the demo/buildpack to work with yarn?

Yes. I'm using Yarn. However, i also tried with npm and i got that error.

@bauerjon
Copy link

bauerjon commented Mar 1, 2022

@matheuschimelli I found that it wasn't related to yarn but the newer version of "playwright-chromium" (or similar).

try hardcoding your package.json value for "playwright-chromium" or similar to 1.15.0. the newer versions seem to have a dependency called "playwright-core" which don't seem to play nicely with the build pack as far as I can tell

@matheuschimelli
Copy link
Author

matheuschimelli commented Mar 1, 2022

@matheuschimelli I found that it wasn't related to yarn but the newer version of "playwright-chromium" (or similar).

try hardcoding your package.json value for "playwright-chromium" or similar to 1.15.0. the newer versions seem to have a dependency called "playwright-core" which don't seem to play nicely with the build pack as far as I can tell

Interesting. Thanks for the tip. I will try it later.

I'm using https://github.com/jontewks/puppeteer-heroku-buildpack.git with playwright and it works like a charm as well.

@ZeroByter
Copy link

Hey guys, so was very frustated at this problem as I had it too, am using Yarn.
I followed your advice, downgraded to 1.15.0 and it works, thanks.
Hopefully a proper fix can be found some time.

@matheuschimelli
Copy link
Author

matheuschimelli commented Mar 2, 2022

Hey guys, so was very frustated at this problem as I had it too, am using Yarn. I followed your advice, downgraded to 1.15.0 and it works, thanks. Hopefully a proper fix can be found some time.

Yes this is sad! But i have hope that one day everything will be better and all of us that are facing issues will have everlast happiness.

@amy-mac
Copy link

amy-mac commented Apr 29, 2022

This just bit us after we upgraded our playwright-chromium package from 1.13 to 1.21. Glad this thread was here to point the way and hope this gets fixed soon.

@hbtalha
Copy link

hbtalha commented Jun 19, 2022

Is there any way to make this work using playwright-python??

@zibdie
Copy link

zibdie commented Jul 17, 2022

Hi, trying to bring this issue back to light.

Using the Python version of Playwright and it seems to compile successfully
heroku_build_log.txt

But getting this in the logs

2022-07-17T22:52:42.235763+00:00 app[web.1]:   File "/app/downloader.py", line 33, in scrapePage

2022-07-17T22:52:42.235763+00:00 app[web.1]:     browser = await p.chromium.launch(

2022-07-17T22:52:42.235763+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 11399, in launch

2022-07-17T22:52:42.235764+00:00 app[web.1]:     await self._impl_obj.launch(

2022-07-17T22:52:42.235764+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/playwright/_impl/_browser_type.py", line 93, in launch

2022-07-17T22:52:42.235766+00:00 app[web.1]:     Browser, from_channel(await self._channel.send("launch", params))

2022-07-17T22:52:42.235766+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 43, in send

2022-07-17T22:52:42.235767+00:00 app[web.1]:     return await self._connection.wrap_api_call(

2022-07-17T22:52:42.235767+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 370, in _

2022-07-17T22:52:42.235767+00:00 app[web.1]:     return await result

2022-07-17T22:52:42.235768+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 78, in inner_send

2022-07-17T22:52:42.235768+00:00 app[web.1]:     result = next(iter(done)).result()

2022-07-17T22:52:42.235769+00:00 app[web.1]: playwright._impl._api_types.Error: Executable doesn't exist at /app/.heroku/python/lib/python3.10/site-packages/playwright/driver/package/.local-browsers/chromium-1012/chrome-linux/chrome

2022-07-17T22:52:42.235769+00:00 app[web.1]: ╔════════════════════════════════════════════════════════════╗

2022-07-17T22:52:42.235770+00:00 app[web.1]: ║ Looks like Playwright was just installed or updated.       ║

2022-07-17T22:52:42.235770+00:00 app[web.1]: ║ Please run the following command to download new browsers: ║

2022-07-17T22:52:42.235771+00:00 app[web.1]: ║                                                            ║

2022-07-17T22:52:42.235771+00:00 app[web.1]: ║     playwright install                                     ║

2022-07-17T22:52:42.235771+00:00 app[web.1]: ║                                                            ║

2022-07-17T22:52:42.235772+00:00 app[web.1]: ║ <3 Playwright Team                                         ║

2022-07-17T22:52:42.235772+00:00 app[web.1]: ╚════════════════════════════════════════════════════════════╝

@birksy89
Copy link

I also have this issue - I've worked on this for 2 days straight and can't seem to solve it.

I've tried to specify a specific verion:

I've also tried using a different buildpack

https://github.com/jontewks/puppeteer-heroku-buildpack.git

I've ensured that these buildpacks come before the heroku/nodejs one.

The issue I cannot seem to navigate is:

browserType.launch: Executable doesn't exist at /app/.cache/ms-playwright/chromium-1019/chrome-linux/chrome

image

app.json

{
  "buildpacks": [{ "url": "heroku/nodejs" }],

  "environments": {
    "test": {
      "stack": "heroku-20",
      "addons": ["heroku-postgresql:in-dyno"],
      "buildpacks": [
        { "url": "https://github.com/mxschmitt/heroku-playwright-buildpack" },
        { "url": "heroku/nodejs" }
      ],
      "scripts": {
        "test": "npx playwright test"
      }
    }
  }
}

I also have a playwright.config.ts setup from the playwright init command.

However removing this doesn't seem to effect the error.

@birksy89
Copy link

Going back to basics this morning - I managed to get it working 🎉

app.json

{
  "buildpacks": [{ "url": "heroku/nodejs" }],
  "addons": ["heroku-postgresql:standard-0"],
  "environments": {
    "test": {
      "stack": "heroku-20",
      "addons": ["heroku-postgresql:in-dyno"],
      "buildpacks": [
        { "url": "https://github.com/mxschmitt/heroku-playwright-buildpack.git" },
        { "url": "heroku/nodejs" }
      ],
      "env": {
        "PLAYWRIGHT_BUILDPACK_BROWSERS": "chromium,firefox"
      },
      "scripts": {
        "test-setup": "npx playwright install",
        "test": "npx playwright test"
      }
    },
    "review": {
      "addons": ["heroku-postgresql:hobby-dev"]
    }
  }
}

playwright.config.ts

image

@rikusen0335
Copy link

rikusen0335 commented Feb 17, 2023

Not advertising just let you know, I found a solution see this for someone who is still getting Please run the following command to download new browsers: npx playwright install-deps:
https://dev.to/rikus3n/deploy-playwright-on-heroku-2c90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants