percy / cli

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.
https://docs.percy.io/docs/cli-overview
70 stars 43 forks source link

ERR_INVALID_ARG_TYPE: When running latest release #1707

Open tmcconechy opened 3 weeks ago

tmcconechy commented 3 weeks ago

The problem

Started getting a new percy error and may be upgrade related

Environment

Details

Running the tests gives errors and does not complete.

Debug logs

tim.mcconechy@USROMTMCCONEC02 enterprise-wc % export PERCY_GZIP=true && npx percy exec -- npx playwright test --grep "percy"
[percy] Notice: Percy collects CI logs to improve service and enhance your experience. These logs help us debug issues and provide insights on your dashboards, making it easier to optimize the product experience. Logs are stored securely for 30 days. You can opt out anytime with export PERCY_CLIENT_ERROR_LOGS=false, but keeping this enabled helps us offer the best support and features.
[percy] Percy has started!
[percy] Running "npx playwright test --grep percy"
[WebServer] Dev server listening on port 4444

Running 127 tests using 5 workers

[percy] Snapshot taken: ids-app-menu-light
[percy] Snapshot taken: ids-area-chart-light
  ✓  2 [chromium] › ids-area-chart/ids-area-chart.spec.ts:44:9 › IdsAreaChart tests › snapshot tests › should match the visual snapshot in percy (2.4s)
  ✓  3 [chromium] › ids-app-menu/ids-app-menu.spec.ts:61:9 › IdsAppMenu tests › snapshot tests › should match the visual snapshot in percy (2.4s)
[percy] Snapshot taken: ids-alert-light
[percy] [] Failed with reason: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
[percy] [] Failed with reason: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
[percy] Encountered an error uploading snapshot: ids-app-menu-light
[percy] TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
node:buffer:319
  throw new ERR_INVALID_ARG_TYPE(
        ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (node:buffer:319:9)
    at base64encode (file:///Users/tim.mcconechy/Dev/enterprise-wc/node_modules/@percy/client/dist/utils.js:25:17)
    at PercyClient.uploadResource (file:///Users/tim.mcconechy/Dev/enterprise-wc/node_modules/@percy/client/dist/client.js:331:26)
    at PercyClient.<anonymous> (file:///Users/tim.mcconechy/Dev/enterprise-wc/node_modules/@percy/client/dist/client.js:351:20)
    at Generator.next (<anonymous>)
    at proceed (file:///Users/tim.mcconechy/Dev/enterprise-wc/node_modules/@percy/client/dist/utils.js:58:22)
    at file:///Users/tim.mcconechy/Dev/enterprise-wc/node_modules/@percy/client/dist/utils.js:73:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Code to reproduce issue

  1. go to branch fix-tests as can be seen on this pr https://github.com/infor-design/enterprise-wc/pull/2766
  2. nvm use && npm i
  3. npx percy exec -- npx playwright test --grep "percy"
revathySV commented 2 weeks ago

Hi, Is this issue still reproducible? - we see that in the recent builds the failing snapshot is being captured (example - https://percy.io/00aaa841/enterprise-wc/builds/36211830/changed/1980008650?browser=chrome&browser_ids=59&group_snapshots_by=similar_diff&subcategories=approved&viewLayout=overlay&viewMode=new&width=1280&widths=375%2C1280)

We are not able to reproduce the issue with the said steps + cli version - the only issue faced was image image

If the issue still exists,

  1. Kindly share the cli verbose logs
  2. Please share the node version you have been using