Closed lucksp closed 1 year ago
I have encountered this issue today when trying to use the orb with Percy and the @Percy/CLI package. It includes await syntax which breaks the orb.
The orb needs to be upgraded to support modern node versions.
@Phonesis what version of the orb are you using? The latest is v2.1.0
.
@admah using the latest 2.1.0
It still seems to be limited to node 10. So no way to use in conjunction with Percy
@Phonesis I think #380 fixes this.
Thanks @admah I will test once merged. Will I just need to use a new orb version number?
@admah seeing same issue still. Do I need to update the circleCI config to specify a new orb version?
It's not released quite yet. I'm working on that now, and will update this issue once it's published. You won't need to specify a new version if you're using the major version marker like cypress-io/cypress@2
.
Great thanks @admah
@Phonesis the latest version (2.2.0) is published and ready to use - https://circleci.com/developer/orbs/orb/cypress-io/cypress
@admah thanks for this, unfortunately getting same error with 2.2.0
> core-js-pure@3.24.1 postinstall /root/project/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
> @percy/core@1.10.1 postinstall /root/project/node_modules/@percy/core
> node ./post-install
(node:127) ExperimentalWarning: The ESM module loader is experimental.
file:///root/project/node_modules/@percy/core/post-install.js:6
await import('./dist/install.js').then(install => install.chromium());
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:117:18)
at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @percy/core@1.10.1 postinstall: `node ./post-install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @percy/core@1.10.1 postinstall script.
@Phonesis I'm not sure what else we can do via the orb. I have updated the image that CircleCI uses to 16.14.2
(seen here), updated ts-node
to its latest, and @types/node
to the latest for 16
.
What executor
are you using?
Thanks @admah this is the config with executor (thought only applied to what Cypress uses as browser):
version: 2.1
orbs:
sonarcloud: sonarsource/sonarcloud@1.1.1
cypress: cypress-io/cypress@2.2.0
executors:
with-chrome:
docker:
- image: 'cypress/browsers:node16.14.2-slim-chrome103-ff102'
Are you not able to reproduce this at your end? From what I can tell, the orb is basically incompatible with Percy as it stands
Further update. I managed to get this to work now but had to apply a different approach to what is outlined in your documentation for the orb.
As a command-prefix I had to add the installation of percy/cli and remove it from package.json in the src code
command-prefix: npm i @percy/cli && npx percy exec --
@Phonesis glad you were able to find a workaround. Do you have a link to the doc you reference? I'd be happy to get that updated.
@admah it is in all the orb docs (the main readme) example of percy usage when using a command-prefix.
Might be worth adding a section specific to Percy and making it clear the cli needs to be installed after the cypress/install job
@admah See this https://github.com/percy/cli/discussions/1048
Any thoughts? We are still getting this issue and cannot use the latest Percy features when using the Cypress orb as a result.
Closing as this appears to be solved via command-prefix
The orb does not work as expected
circle.yml
file if possible or at least the relevant portionexecutors: node: docker: