playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
2.26k stars 163 forks source link

[Bug]: could not start playwright: please install the driver (v1.47.0) and browsers first: %!w(<nil>) when trying to run on CloudRun #486

Closed lukackaadam closed 2 months ago

lukackaadam commented 2 months ago

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

Problem is when I deploy this to Google Cloud Run

this deploys my api and API works fine. the problem is that when I make a request to my resolver where I start playwright

pw, err := playwright.Run()
    if err != nil {
        log.Printf("could not start playwright: %v", err)
        return nil, errors.New("Error contact support.")
    }

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

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>)

canstand commented 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.

lukackaadam commented 2 months ago

it was couple things

As I thought it will be handled by docker file but how wrong I was.