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
71 stars 45 forks source link

Upgrading from -beta.71 to -beta.74 broke my Jenkins build #756

Closed nyghtly-derek closed 2 years ago

nyghtly-derek commented 2 years ago

The problem

Upgrading the Percy CLI version broke my Jenkins build... Not sure why. To be honest, this is probably user error, but I thought I would drop it here anyways. Hopefully this will help others with the same problem.

Environment

Also using nix, which is probably relevant...

Debug logs

12:46:44  > @ run_percy /workspace
12:46:44  > branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD); PERCY_TARGET_BRANCH=$branch PERCY_TOKEN=$CYPRESS_PERCY_TOKEN npx percy "exec:stop"
12:46:44  
12:46:44  (node:18297) UnhandledPromiseRejectionWarning: Error: Not supported
12:46:44      at Object.<anonymous> (/workspace/node_modules/@percy/cli/bin/run:9:1)
12:46:44      at Module._compile (internal/modules/cjs/loader.js:868:30)
12:46:44      at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
12:46:44      at Module.load (internal/modules/cjs/loader.js:731:32)
12:46:44      at Function.Module._load (internal/modules/cjs/loader.js:644:12)
12:46:44      at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
12:46:44      at /usr/local/lib/node_modules/npm/node_modules/libnpx/index.js:268:14
12:46:44  (node:18297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
12:46:44  (node:18297) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Details

Reverting the version change fixed it in Jenkins. Both versions work fine with I run it outside of the Jenkins environment. For example, on a macOS with node 12.21

Robdel12 commented 2 years ago

Hey @nyghtly-derek! This had to do with #769 -- we accidentally shipped an ESM module before we should have. Upgrading to beta 75 should fix this. As a heads up, we will be going all in on ESM which will require node 12.22+, but that likely will happen at the same time we require node 14 support since node 12 will be EOL'd in ~2 months.