-
Notifications
You must be signed in to change notification settings - Fork 721
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
Playwright requires installation via npx playwright install
#2275
Comments
So you can reproduce this from some template, or by installing crawlee into an empty project? Because the templates are working fine on my end. I believe the browsers are installed via postinstall hook nowadays, cc @vladfrangu |
Yep, both apify and crawlee templates have a postinstall hook (that also ensures it won't run in our docker images, but will run everywhere else) We should probably document the CLI command to users who are upgrading to newer playwright or are making new projects without our CLI. Could even just make a command in CLI to auto fix old projects ( |
Hmm, probably not worth introducing a new command just to wrap an existing playwright command that's documented in the error. So all the "default" and "new user" paths of installing crawlee are covered with this then? And I was just unlucky because I reinstalled an old project? |
This is fixed for any users who create their project via apify create or crawlee create.. Otherwise, the postinstall hook needs to be added into the project (which is why I suggested making a cmd for it, to automate it for users) |
Cant we have it on the |
Well...we install the package all the time, so running the command when people don't use playwright isn't ideal either... Not sure what the best solution is |
Hmm but in the end, we want this to work with the |
Can we have some env var to skip the downloads in the postinstall script? I'd probably just install them all the time and allow opting out, that was the previous behavior before all this mess happened. |
I am getting the dreaded:
With the only code change being adding a new express route. I also defined 2 request queues following some internet skim reading. Running locally everything works as expected, but this issue is occuring via GCP Cloud Run. I am using My logs show this error:
and having pulled down the image and running locally via docker I can confirm that the only browsers present in
New route:
Any advice on how to resolve or if this is unrelated would be amazing. Before I had simply followed the documentation instructions with a top-level express.js route. I am using a specific handler needed only for |
Sounds like your playwright version doesn't match the one we use when building images. You should specify it in the image version tag (so you'd have |
In fairness, I was using a wildcard for the playwright version in my Error message is the same as above regarding missing browser |
If you use a range like that it'll still install the latest version that matches, you'd need to either use If you're able to make a reproducible sample in a repository that'd help a bunch too! |
I will move to relevant thread as this relates to, having narrowed down the problem to the Dockerfile or atleast this element of my pipeline. Confirmed by simple rebuilding and redeploying an unchanged project (i.e expected to be the equivalent to a rollback) and still getting the same error around the lack of that specific browser |
I am getting same error
|
Same here |
Same problem, I installed crawlee as |
@B4nan should we close this, because it's been solved and a reoccurrence means wrong configuration, or is this still an issue? |
I guess we are still missing proper docs around this, so let's keep it open for a bit more. I also wanted to pin the browser versions in docker tags in templates and polish all of that finally. |
Which package is this bug report for? If unsure which one to select, leave blank
@crawlee/playwright (PlaywrightCrawler)
Issue description
When you install a project with the following
package.json
it fails on first start asking tonpx install playwright
.It's not a great first experience to get a huge error on first run, so we should either:
@crawlee/playwright
orIt's likely that to reproduce this, you first need to
npx playwright uninstall
to get into a "new user state".This probably also impacts all our CLI templates.
Code sample
Package version
3.7.1
Node.js version
v18.12.1
Operating system
MacOS
Apify platform
I have tested this on the
next
releaseno
Other context
No response
The text was updated successfully, but these errors were encountered: