Closed lukackaadam closed 2 months ago
Maybe the version in go.mod
is not v0.4700.0
when you build the container image? A rebuild is required every time the playwright-go major or minor version number is updated.
it was couple things
if err := playwright.Install(&playwright.RunOptions{
Browsers: []string{"chromium"},
// DriverDirectory: "/tmp/playwright",
SkipInstallBrowsers: false,
Verbose: true,
}); err != nil {
log.Fatalf("could not install playwright here: %v", err)
}
As I thought it will be handled by docker file but how wrong I was.
Environments
Bug description
Hi, I am running golang project which uses playwright. Everything works locally and I can use playwright and it installs and run Browser and gets to URL no problem
docker build -t api:1 .
docker run -d -p 8080:8080 api:1
Problem is when I deploy this to Google Cloud Run
docker build -t gcr.io/my-project/api:1 .
docker push gcr.io//my-project/api:1
gcloud run deploy --image gcr.io//my-project/api:1 --platform managed
this deploys my api and API works fine. the problem is that when I make a request to my resolver where I start playwright
I get this error back
could not start playwright: please install the driver (v1.47.0) and browsers first: %!w(<nil>)
To Reproduce Steps above in bug description
Go project setup My setup is golang + graphql
gql-user
folderfunc (r *Resolver) GetTestData(p graphql.ResolveParams) (interface{}, error) {
"github.com/playwright-community/playwright-go"
As I mentioned this works fine locally but as soon as I push the container to Cloud Run I am getting the error that
could not start playwright: please install the driver (v1.47.0) and browsers first: %!w(<nil>)