vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo
MIT License
26.47k stars 1.84k forks source link

Docs: Turborepo 2.0 and playwright docker container #8386

Open citypaul opened 5 months ago

citypaul commented 5 months ago

What is the improvement or update you wish to see?

I'm just adding this here so people can find it on Google, because my Playwright docker container started failing when I tried to upgrade to turborepo 2.0.

For those who are experiencing this issue:

  1) [chromium] › login.spec.ts:6:5 › user can login with correct details ──────────────────────────

    Error: browserType.launch: Executable doesn't exist at /github/home/.cache/ms-playwright/chromium-1117/chrome-linux/chrome
    ╔═════════════════════════════════════════════════════════════════════════╗
    ║ Looks like Playwright Test or Playwright was just installed or updated. ║
    ║ Please run the following command to download new browsers:              ║
    ║                                                                         ║
    ║     pnpm exec playwright install                                        ║
    ║                                                                         ║
    ║ <3 Playwright Team                                                      ║
    ╚═════════════════════════════════════════════════════════════════════════╝

When running with a setup using the playwright docker container (in my instance, running with mcr.microsoft.com/playwright:v1.44.1-jammy), the solution was to add:

PLAYWRIGHT_BROWSERS_PATH to globalEnv in your turbo.json file.

I'm not sure this needs to be added to the docs specifically or not, but I figured making a post here would make it easier for people who are googling to find a solution to the same issue.

Is there any context that might help us understand?

I'm just adding the above to make this issue googleable. If this isn't the right place, please let me know and I'll move it.

Does the docs page already exist? Please link to it.

No response

anthonyshew commented 5 months ago

Quick note: globalEnv will cause cache misses for all tasks when PLAYWRIGHT_BROWSERS_PATH changes. You might want to use the task's env or passThroughEnv instead.

Additional context: There's a Playwright doc that still needs to be written that will include this information. Thanks for putting the fix you found into the open for now. 🙌

citypaul commented 5 months ago

@anthonyshew ah, thanks for that, I'll update my own setup accordingly :)

taylorfsteele commented 5 months ago

@citypaul @anthonyshew Just ran into this and was able to fix this pretty quickly thanks to your posts here. For anyone else, all I had to do was add the PLAYWRIGHT_BROWSERS_PATH to the env of the task, just like @anthonyshew said.

    "test:playwright": {
      "dependsOn": ["build"],
      "env": ["PLAYWRIGHT_BROWSERS_PATH"]
    }

Thank you!!

AlecRust commented 4 months ago

There's a Playwright doc that still needs to be written that will include this information

Any word on when this will be released.?

RubenT86 commented 3 weeks ago

I spent 4 hours this morning trying to solve this problem. Fortunately, after a long (erroneous) search, I came upon this post! I searched for issues at playwright and docker, but didn't realize that this issue was related to a turbo update....

Thank you so much!