percy/percy-cypress

error finalizing build

NorfeldtAbtion opened this issue · 4 comments

This seems like #8 but this is not running anything in docker (or parallel). Just started the react app locally yarn start and fired this in another terminal tabl

PERCY_TOKEN=<token> PERCY_BRANCH=local yarn percy exec -- cypress run

Then throws this:

[percy] stopping percy...
[percy] waiting for 1 snapshots to complete...
[percy] StatusCodeError 413 - "<html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body>\r\n<center><h1>413 Request Entity Too Large</h1></center>\r\n<hr><center>nginx/1.16.1</center>\r\n</body>\r\n</html>\r\n" | Thu Feb 25 2021 15:18:02 GMT+0100 (Central European Standard Time)
[percy] StatusCodeError 400 - {"errors":[{"status":"bad_request","detail":"Finalizing snapshot 512614462 failed: cannot finalize before all snapshot resources are uploaded. This is likely a client library bug, please make sure that content for all SHAs in 'missing-resources' from the snapshot response are uploaded before calling finalize."}]} | Thu Feb 25 2021 15:18:02 GMT+0100 (Central European Standard Time)
[percy] done.
[percy] error finalizing build
[percy] StatusCodeError 400 - {"errors":[{"status":"bad_request","detail":"Finalizing build 9042251 failed: cannot finalize before all snapshot resources are uploaded. This is likely a client error, please make sure that content for all SHAs in 'missing-resources' from the snapshot response are uploaded before calling finalize."}]} | Thu Feb 25 2021 15:18:03 GMT+0100 (Central European Standard Time)

Looking at the percy build dashboard

Screenshot 2021-02-25 at 15 34 51

👋🏼 Hey @NorfeldtAbtion! This is the error here:

[percy] StatusCodeError 413 - "<html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body>\r\n<center><h1>413 Request Entity Too Large</h1></center>\r\n<hr><center>nginx/1.16.1</center>\r\n</body>\r\n</html>\r\n" | Thu Feb 25 2021 15:18:02 GMT+0100 (Central European Standard Time)

That means there's an asset larger than 15mb on the page that's being captured. A lot of the time this is due to CSS including source maps (which can be really heavy).

@Robdel12 arhh.. Guessing that it would help if I run the percy test on build instead. You would happen to know the best way to do this with github actions?

Currently my gh action looks like this:

name: Percy
on: [push]
jobs:
  percy:
    name: Visual Testing
    runs-on: ubuntu-16.04
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Cypress run
        uses: cypress-io/github-action@v2
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
        with:
          start: npm start
          wait-on: 'http://localhost:3000'
          command-prefix: 'percy exec -- npx'

I installed serve and tried to change the start to start: yarn build serve -s build -p 3000 but it does not seem to start the server

This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

This issue was closed because it has been stalled for 28 days with no activity.