Comments (19)
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
from percy-cypress.
was a resolution to this? I'm getting this sporadically in my build environment it will be 1 out of 300 test maybe but enough to be annoying.
We are on Cypress 9.6.1 and just using cypress default prepossessing with webpack.
from percy-cypress.
Any updates on this, I get a similar error on Cypress v9.7.0 with the latest Percy installed
npx percy exec -- cypress run --spec cypress/integration/RandR/Visual/*
TypeError: Cannot read properties of undefined (reading 'write')
at Function../node_modules/@percy/sdk-utils/dist/logger.js.logger.log (https://site1.dev/__cypress/tests?p=cypress/integration/RandR/Visual/pdf.spec.js:37669:53)
at Object.info (https://site1.dev/__cypress/tests?p=cypress/integration/RandR/Visual/pdf.spec.js:37615:29)
at Object.isPercyEnabled (https://site1.dev/__cypress/tests?p=cypress/integration/RandR/Visual/pdf.spec.js:37815:11)
at async Context.eval (https://site1.dev/__cypress/tests?p=cypress/integration/RandR/Visual/pdf.spec.js:37450:10)
Any ideas?
from percy-cypress.
Hey @ayaanqui! This sounds like it's a compile issue -- are you doing anything in your cypress setup that changes how code is bundled? It looks like logger is being bundled in Cypress and process.stdout
is polyfilled to be undefined
.
from percy-cypress.
@Robdel12 here's what my cypress.json
looks like:
{
"baseUrl": "http://localhost:3000/stockcenter",
"video": false,
"defaultCommandTimeout": 10000,
"chromeWebSecurity": false
}
from percy-cypress.
The pre-processor wouldn't be configured in the cypress.json
-- looks like it's done in the plugins file: https://docs.cypress.io/api/plugins/preprocessors-api#Examples
Given this isn't an issue on the out-of-box setup (percy/example-percy-cypress@3f44d16), there's something different about your test suite causing this. A reproduction repo would be helpful
from percy-cypress.
We are also facing this issue π What should we look for in the plugins file?
from percy-cypress.
I'm not sure -- what is different in your plugins file? The issue is deff related to the bundle and how Percy's SDK is being polyfilled incorrectly. Something is not picking the correct bundle we're providing (we provide both a browser and node library).
A reproduction project would probably be most helpful since I can't replicate on a fresh cypress project. π€¨
from percy-cypress.
@Robdel12 Apologies for the late response, but I did make a repo that reproduces the issue github.com/ayaanqui/percy-snapshot-demo. Let me know if the project works for you. make sure to run yarn install
then yarn start
and finally yarn cypress:run
which should fail the tests as shown in this issue. The test file should be in cypress/integration/test.ts.
from percy-cypress.
Can we somehow escalate this issue - is happening more and more. Will try to update cypress to version9 today to see if that improves anything
from percy-cypress.
@alexbjorlig Yes, I have noticed on other repos as well this is definitely an issue. github.com/ayaanqui/percy-snapshot-demo does replicate the issue as described here. Do let me know if you manage to find a solution.
from percy-cypress.
ππΌ This seems to be an issue with how TypeScript is bundling the tests together. We ship a different version of the logger for browsers and node. For some reason, the node version is being pulled in and then polyfilled since itβs a node API.
Did this start happening with a specific version of typescript? Or has this always been an issue?
from percy-cypress.
For me this wasn't always the case, tests used to work fine. The errors started after upgrading for sure, but I'm not entirely sure from what version exactly
from percy-cypress.
even i have noticed this issue after upgrading to cypress version 8, I tried to downgrade the cypress version to 7.7.0 , still issue persists. not sure what went wrong. Please suggest me on this issue . Thanks in advance!
from percy-cypress.
We won't have time to really dig in until next week, but it's not an issue with Cypress. Looks to be an issue with TypeScript / how tests are being bundled. Might be worth downgrading TypeScript to see where/if the error goes away
from percy-cypress.
I'm getting this now too, I just updated to cypress version 10 and bumped the percy sdk to the latest before that update I was getting the 'isTTY" message.
from percy-cypress.
This is a dependency resolution issue within your project's build tool that can't be fixed by us.
node_modules/@percy/sdk-utils/dist/logger.js
This is a Node export for the package, but you are using it in a Cypress browser, which is why you are seeing an error when it tries to access Node things.
The correct file for browsers should be node_modules/@percy/sdk-utils/dist/bundle.js
. The package.json for the @percy/sdk-utils
project correctly defines this as the browser bundle with all other exports being meant for Node.
So if the dependency resolution in your project is getting this wrong, then whatever tool is being used in your project is not correctly using these package.json standards (or is not configured to prefer browser bundles over Node entrypoints).
Closing this now since this isn't a bug on our end
from percy-cypress.
This issue keeps coming up for us and we just try the workflow but I have been asked to review it again. I'm not sure I understand you point that is its a dependency issue because for us it will take several sshots then hit this error, if it was a dependency issue would we hit it in the first go or hit it all the time (we often can re-try and it will work)
from percy-cypress.
@stbth01 I ran into this while trying to update some repositories within Cypress that leverage Percy integration. You likely need to set __PERCY_BROWSERIFIED__
for sdk-utils
to be aware that it isn't running in node.js
. You can do that in webpack like this:
plugins: [
new webpack.DefinePlugin({
'process.env.__PERCY_BROWSERIFIED__': true
})
]
from percy-cypress.
Related Issues (20)
- How to select Approved build as base build?
- Webpages behind Netlify Authentication not showing css in Percy snapshot
- [Cypress regression]`TypeError: data.hasOwnProperty is not a function` HOT 12
- [percy] Fails to take dom snapshot
- Does percy with cypress support visual testing of shadow dom elements? HOT 1
- `cy.percySnapshot()` not uploading screenshots when used via `browserstack-cypress` HOT 1
- Percy does not work for Cypress component testing
- Cannot read properties of undefined (reading 'isServer') HOT 9
- SyntaxError: Unexpected identifier HOT 2
- Test is marked as successful, but `Could not take DOM snapshot` error is present.
- The term 'percy' is not recognized as the name of a cmdlet
- Duplicate snapshot name in a parallel build causes missing snapshots HOT 13
- Need the ability to set width and height for screenshots HOT 2
- Snapshot ignores the passed `scope` and renders the whole screen HOT 3
- Percy no longer captures embedded pdf viewer since Cypress v12.15.0 and above HOT 4
- Uncaught error was detected outside of a test: No commands were issued in this test HOT 3
- Specifying "width" instead of "widths" in percySnapshot HOT 4
- Cannot finalize before all snapshots have comparisons created HOT 2
- Images not captured by percy with cypress v13.6.4 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from percy-cypress.