Giter Site home page Giter Site logo

Comments (6)

Robdel12 avatar Robdel12 commented on May 23, 2024

I think we might already have logging for this, but LOG_LEVEL=debug needs to be enabled: https://github.com/percy/percy-agent/blob/6375078eb74a263d6a6e2e131225e9206f2f1ae7/src/utils/sdk-utils.ts#L25

Might also have to be done upstream from here. I'm going to try and slice some time out today to confirm

from percy-puppeteer.

Robdel12 avatar Robdel12 commented on May 23, 2024
✗ yarn percy
yarn run v1.15.2
$ percy exec -- node ./index.js
[percy] created build #607: [URL]
[percy] percy has started.
[percy] Error posting snapshot to agent
[percy] stopping percy...
[percy] waiting for 0 snapshots to complete...
[percy] done.
[percy] finalized build #607: [URL]
✨  Done in 5.56s.

The LOG_LEVEL=debug logs were HUGE (since the repro uses base64 to create a 13mb DOM). Here's a clipped version:

➜ (master) ✗ yarn percy:debug
yarn run v1.15.2
$ LOG_LEVEL=debug percy exec -- node ./index.js
[percy] created build #609: [URL]
[percy] -> assetDiscoveryService.puppeteer.launch durationMs=167
[percy] -> assetDiscoveryService.browser.newPagePool durationMs=166
[percy] percy has started.
[percy] Error posting snapshot to http://localhost:5338/percy/snapshot with body: [object Object]
[percy]  message=Request body larger than maxBodyLength limit, stack=Error: Request body larger than maxBodyLength limit
    at RedirectableRequest.write (/Users/robertdeluca/Projects/Work/scratch/project/node_modules/follow-redirects/index.js:105:24)
    at RedirectableRequest.end (/Users/robertdeluca/Projects/Work/scratch/project/node_modules/follow-redirects/index.js:130:10)
    at dispatchHttpRequest (/Users/robertdeluca/Projects/Work/scratch/project/node_modules/axios/lib/adapters/http.js:234:11)
    at new Promise (<anonymous>)
    at httpAdapter (/Users/robertdeluca/Projects/Work/scratch/project/node_modules/axios/lib/adapters/http.js:18:10)
    at dispatchRequest (/Users/robertdeluca/Projects/Work/scratch/project/node_modules/axios/lib/core/dispatchRequest.js:59:10)
    at process._tickCallback (internal/process/next_tick.js:68:7), adapter=function httpAdapter(config) {
  return new Promise(function dispatchHttpRequest(resolve, reject) {
    var data = config.data;
    var headers = config.headers;
    var timer;

    // Set User-Agent (required by some servers)

Notice the log:

[percy] Error posting snapshot to http://localhost:5338/percy/snapshot with body: [object Object]

So we'll need to stringify that & probably console.log it? Or something so they don't have to put LOG_LEVEL=debug in front of their command.

from percy-puppeteer.

Robdel12 avatar Robdel12 commented on May 23, 2024

Can confirm adding maxContentLength to our postSnapshot method makes it work 👍

 ✗ yarn percy
yarn run v1.15.2
$ percy exec -- node ./index.js
[percy] created build #610: [URL]
[percy] percy has started.
[percy] snapshot taken: 'Does this snapshot?'
[percy] stopping percy...
[percy] waiting for 1 snapshots to complete...
[percy] done.
[percy] finalized build #610: [URL]
✨  Done in 25.79s.

from percy-puppeteer.

Robdel12 avatar Robdel12 commented on May 23, 2024

I think we should set the limit high in the SDK and allow the API to return the error here. That way we're not trying to check content size in the SDK when the API already does. It'll return a 419 with the error message already

from percy-puppeteer.

djones avatar djones commented on May 23, 2024

Thanks @Robdel12. Pulling a PR for this together shortly.

from percy-puppeteer.

djones avatar djones commented on May 23, 2024

Closing with the release of percy/percy-agent#118

Upgrade to @percy/[email protected] or higher to be able to snapshot larger ~16mb DOMs.

from percy-puppeteer.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.