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

percy/cli v1.27 incompatible with percy-cypress #1352

Closed esetnik closed 1 year ago

esetnik commented 1 year ago

The problem

prodigy-cypress-1     | Oops...we found an error preparing this test file:
prodigy-cypress-1     | 
prodigy-cypress-1     |   > cypress/support/e2e.ts
prodigy-cypress-1     | 
prodigy-cypress-1     | The error was:
prodigy-cypress-1     | 
prodigy-cypress-1     | Error: Webpack Compilation Error
prodigy-cypress-1     | ./node_modules/@percy/sdk-utils/dist/bundle.js 287:18
prodigy-cypress-1     | Module parse failed: Unexpected token (287:18)
prodigy-cypress-1     | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
prodigy-cypress-1     | | 
prodigy-cypress-1     | |     class TimeIt {
prodigy-cypress-1     | >       static data = {};
prodigy-cypress-1     | |       static enabled = process.env.PERCY_METRICS === 'true';
prodigy-cypress-1     | |       static async run(store, func) {
prodigy-cypress-1     |  @ ./node_modules/@percy/cypress/index.js 1:14-41
prodigy-cypress-1     |  @ ./cypress/support/commands.ts
prodigy-cypress-1     |  @ ./cypress/support/e2e.ts

Environment

newsuk-apnikolov commented 1 year ago

We see the same issue, but we are using 1.26.2 CLI Version. @percy-bot can you check this guys, because we lost testing coverage, this error broke all our tests (api, e2e, integration, staging)

itsjwala commented 1 year ago

Thankyou for reporting, we'll look into it today.

sdedieu commented 1 year ago

Hi ! Waiting for the fix, do you know what are the latest versions of @percy/cli and @percy/cypress that are working well with each other ?

Thanks !

itsjwala commented 1 year ago

CLI version prior to v1.27.0 should work with percy-cypress [ this error trace code reported is coming from v1.27.0]

sdedieu commented 1 year ago

I do have this issue with: "@percy/cli": "1.10.4" & "@percy/cypress": "3.1.2" and I understood @newsuk-apnikolov also having the issue with "@percy/cli": "1.26.2".

Do we know 2 versions that works together ?

newsuk-apnikolov commented 1 year ago

@sdedieu check you cypress version, we used 12.17.3. So once I updated the version to 12.17.4 (Cypress update the webpack version from 4-5 ) this resolved my issue. Also I tried with older versions of Cypress - 10+ and 11+ I face the same error.

Amit3200 commented 1 year ago

Hi All, We have identified the issue, we are working on the fix for the same. It seems like that webpack 4 is not compatible with the syntax of static variables inside class. The error trace code is from @percy/cli version : v1.27.0, which was released recently.

Amit3200 commented 1 year ago

Hi All, We have released a latest CLI Version with the fix. CLI Version v1.27.1 should not have any issues.

Release Details: https://github.com/percy/cli/releases/tag/v1.27.1