#[Chrome] Playwright extension deployment build error

1 messages · Page 1 of 1 (latest)

bitter lichen
#

Getting this error using the playwright extension during deployment. Running on v4-beta.27. Can confirm this is only for chrome, I tried deploying with Firefox and got no errors with it.

10 |     RUN INSTALL_DIR=$(grep "Install location:" /tmp/chromium-info.txt | cut -d':' -f2- | xargs) &&           DIR_NAME=$(basename "$INSTALL_DIR") &&           if [ -z "$DIR_NAME" ]; then echo "Failed to extract installation directory for chromium"; exit 1; fi &&           MS_DIR="/ms-playwright/$DIR_NAME" &&           mkdir -p "$MS_DIR"
11 |     RUN DOWNLOAD_URL=$(grep "Download url:" /tmp/chromium-info.txt | cut -d':' -f2- | xargs | sed "s/mac-arm64/linux/g" | sed "s/mac-15-arm64/ubuntu-20.04/g") &&           if [ -z "$DOWNLOAD_URL" ]; then echo "Failed to extract download URL for chromium"; exit 1; fi &&           echo "Downloading chromium from $DOWNLOAD_URL" &&           curl -L -o /tmp/chromium.zip "$DOWNLOAD_URL" &&           if [ $? -ne 0 ]; then echo "Failed to download chromium"; exit 1; fi &&           unzip -q /tmp/chromium.zip -d "/ms-playwright/$(basename $(grep "Install location:" /tmp/chromium-info.txt | cut -d':' -f2- | xargs))" &&           if [ $? -ne 0 ]; then echo "Failed to extract chromium"; exit 1; fi &&           chmod -R +x "/ms-playwright/$(basename $(grep "Install location:" /tmp/chromium-info.txt | cut -d':' -f2- | xargs))" &&           rm /tmp/chromium.zip
--------------------
ERROR: failed to solve: process "/bin/sh -c grep -A5 \"browser: chromium-headless-shell\" /tmp/browser-info.txt > /tmp/chromium-info.txt" did not complete successfully: exit code: 1
autumn crestBOT
#

Hi @bitter lichen. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources, the Playwright build extension for Trigger.dev v4 is designed to handle browser installations (including Chromium/Chrome) automatically during the build and deploy process. However, your error:

ERROR: failed to solve: process "/bin/sh -c grep -A5 \"browser: chromium-headless-shell\" /tmp/browser-info.txt > /tmp/chromium-info.txt" did not complete successfully: exit code: 1

suggests that the build script is failing to extract Chromium installation information from /tmp/browser-info.txt. This is likely a problem with how the Playwright extension is handling Chromium specifically, as you noted that Firefox works without issue.

What you can try:

  1. Check Playwright Version Compatibility:
    The Playwright extension auto-detects the version from your dependencies unless you specify it. If you have a version mismatch or an unsupported version, it could cause build failures. Try removing any explicit version or ensure your Playwright version is compatible with the extension.
    Example config:
    import { defineConfig } from "@trigger.dev/sdk/v3";
    import { playwright } from "@trigger.dev/build/extensions/playwright";
    
    export default defineConfig({
      project: "<project ref>",
      build: {
        extensions: [
          playwright({
            browsers: ["chromium"], // or ["chromium", "firefox"]
            // version: "1.43.1", // try omitting this for auto-detection
          }),
        ],
      },
    });
    
    Playwright extension docs
#
  1. Try a Clean Build:
    Sometimes, stale build artifacts can cause issues. Run the deploy command with the --dry-run flag to inspect the build output and see if the error persists:

    npx trigger.dev deploy --dry-run
    

    This will let you inspect the build directory for clues and avoid an actual deployment if the build fails.
    Deployment troubleshooting

  2. Enable Debug Logging:
    Run the deploy command with --log-level debug to get more detailed logs:

    npx trigger.dev deploy --log-level debug
    

    This may provide more context about why the script is failing.
    Troubleshooting custom extensions

  3. Recent Fixes:
    The v4 changelog mentions improvements to Playwright non-headless Chrome installation in v4.0.0-beta.27 (#2347), so ensure you are on at least this version. If you are, and the issue persists, it may be a new or edge-case bug.
    v4 beta changelog

If the problem continues:

  • This may be a bug or an unsupported edge case in the Playwright extension for Chromium.
  • Join the Trigger.dev Discord and share your debug logs privately for more direct support, as recommended in the docs.

Summary:
The error is likely due to a build script issue in the Playwright extension when handling Chromium. Try the steps above to diagnose or work around the problem. If none resolve it, reaching out to the Trigger.dev team with debug logs is the best next step.

#

If you need more detailed help, please provide the full debug log output or a minimal reproducible example as suggested in the docs.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@bitter lichen Kapa.ai is still learning and improving, please let me know how I did by reacting below.

autumn crestBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

I'm sorry, but "keemattes" does not appear to be a question or a topic related to Trigger.dev. If you have a specific question about Trigger.dev, please let me know and I'll be happy to help!

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@bitter lichen Kapa.ai is still learning and improving, please let me know how I did by reacting below.

bitter lichen
#

@autumn crest Yes I am on the latest version. Firefox works but chrome don't

autumn crestBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Thank you for confirming you are on the latest version (v4.0.0-beta.27) and that Firefox works but Chrome (Chromium) does not.

Based on the knowledge sources, the Playwright extension in v4-beta.27 includes improvements for non-headless Chrome installation (#2347), but there is no explicit mention of a known issue or a guaranteed fix for the specific error you are encountering with Chromium. The error you posted indicates a failure in extracting Chromium installation information during the build process, which is handled internally by the extension scripts.

The documentation suggests the following steps for troubleshooting build extension issues:

  • Run with debug logging:
    Use npx trigger.dev deploy --log-level debug to get more detailed logs, which may help identify the root cause of the failure.

  • Try a dry run:
    Use npx trigger.dev deploy --dry-run to inspect the build output without deploying. This can help you see exactly where the build is failing and what files are being generated.

  • Discord support:
    If the above steps do not resolve the issue, the docs recommend joining the Trigger.dev Discord and sharing your debug logs privately for further assistance, as the logs may contain sensitive information.

At this time, the knowledge sources do not provide a direct solution for this specific Chromium build error. The issue may be related to an edge case or a bug in the Playwright extension's handling of Chromium in the deployment environment. If you have already tried the latest version and the recommended troubleshooting steps, reaching out to the Trigger.dev team with your debug logs is the best next step.

#

@bitter lichen Kapa.ai is still learning and improving, please let me know how I did by reacting below.

hard agate