Skip to content
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

Screenshot fails to be taken: Error: Could not find Chromium #14

Open
jwr0 opened this issue Feb 16, 2023 · 0 comments
Open

Screenshot fails to be taken: Error: Could not find Chromium #14

jwr0 opened this issue Feb 16, 2023 · 0 comments

Comments

@jwr0
Copy link

jwr0 commented Feb 16, 2023

This action looks great but it doesn't work when I try it. My use case it to build a static site with hugo, then take a screenshot of the HTML file which was built. Here's my YAML:

name: Screenshot Commenter

on:
  pull_request:
    types:
      - opened
      - reopened
      - synchronize

jobs:
  deploy:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true  # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'

      - name: Build
        run: hugo --minify

      - name: cat index.html for debugging
        run: cat public/index.html

      # Run Screenshot Comment Action
      - name: Run Screenshot Comment Action
        uses: saadmk11/comment-website-screenshot@main
        with:
          upload_to: github_branch
          # Capture Screenshots of Changed HTML Files
          capture_changed_html_files: no
          # Comma seperated paths to any other HTML File
          capture_html_file_paths: "public/index.html"

Note that the cat public/index.html step does show the expected content in the raw HTML file.

Here's the error I get from the screenshot action:

Capture Screenshot for "public/index.html"
  Error: Could not find Chromium (rev. 1095492). This can occur if either
   1. you did not perform an installation before running the script (e.g. `npm install`) or
   2. your cache path is incorrectly configured (which is: /github/home/.cache/puppeteer).
  For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
      at ChromeLauncher.resolveExecutablePath (file:///usr/lib/node_modules/capture-website-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ProductLauncher.js:101:27)
      at ChromeLauncher.executablePath (file:///usr/lib/node_modules/capture-website-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:177:25)
      at ChromeLauncher.launch (file:///usr/lib/node_modules/capture-website-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:64:37)
      at async internalCaptureWebsite (file:///usr/lib/node_modules/capture-website-cli/node_modules/capture-website/index.js:149:33)
      at async file:///usr/lib/node_modules/capture-website-cli/cli.js:289:24
  Error: Error while trying to Capture Screenshot for "public/index.html". Error: b''

I also tried uses: saadmk11/comment-website-screenshot@v0.5, but with the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant