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

`checkForUpdate is not a function` in CircleCI #716

Closed knownasilya closed 2 years ago

knownasilya commented 2 years ago

The problem

Running percy exec -- cypress run in CircleCI returns an error and crashes.

Environment

Details

The error is

(node:246) UnhandledPromiseRejectionWarning: TypeError: checkForUpdate is not a function
    at /home/circleci/teamgantt-web-client/node_modules/@percy/cli/bin/run:11:11
(Use `node --trace-warnings ...` to show where the warning was created)
(node:246) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:246) [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.

Debug logs

Adding --debug didn't add any details, as this function seem to be early in the cli process.

knownasilya commented 2 years ago

1.0.0-beta.71 seems to run but I get this

[percy] Stopping percy...
[percy] Build not created

Exited with code exit status 3
CircleCI received exit code 3

And 1 snapshot passed and is in the percy ui, but the 3 failed ones are missing.

Running:  components/my-projects/my-projects.js                                          (9 of 11)
[percy] Snapshot taken: My Projects can visit /my-projects

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        4                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      3                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  3                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     17 seconds                                                                       │
  │ Spec Ran:     components/my-projects/my-projects.js                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

  (Screenshots)

  -  /home/circleci/teamgantt-web-client/cypress/screenshots/components/my-projects/m     (1280x720)
     y-projects.js/My Projects -- can visit my-projectson-hold (failed).png                         
  -  /home/circleci/teamgantt-web-client/cypress/screenshots/components/my-projects/m     (1280x720)
     y-projects.js/My Projects -- can visit my-projectscomplete (failed).png                        
  -  /home/circleci/teamgantt-web-client/cypress/screenshots/components/my-projects/m     (1280x720)
     y-projects.js/My Projects -- can visit my-projectsother (failed).png

No additional details with --debug or --verbose