Closed pun-ky closed 2 years ago
Just ran into the same issue. Note that it works with Cypress v9.0, but not with v9.1
👋🏼 I'm not at my computer to debug this yet but it feels like a red herring that there's nothing Percy related in that stack trace. Why is there bluebird in the stack trace (really old promise dep)? 🤨
I see "typescript": "4.5.2",
in your provided packag.json. Given the example app works fine with Cypress v9, I suspect this is actually a typescript + Cypress problem (and maybe + Percy too, there's also this annoying TS bug: https://github.com/percy/percy-cypress/issues/430)
@Robdel12 This appears to be related to percy: if I remove all the related code to percy, it works fine again in my case (on several projects). We do use TS as well, both TS 4.4 and TS 4.5.
This sure does smell a lot like https://github.com/cypress-io/cypress/issues/15101 & https://github.com/percy/percy-cypress/issues/325
It does. I also had that issue in the past, but this was fixed and had not happened again since.
FYI someone opened a similar issue on Cypress https://github.com/cypress-io/cypress/issues/19091
Also getting this issue after upgrade to 9.1.0, I have percy enabled.
Downgrading to Cypress 9.0.0 Resolves the issue for me. Note: Not using Typescript
We're seeing error this happen, but only in specs that have involve @percy/cypress
, and only as of Cypress 9.1.
My guess is Cypress had a regression in their networking stack. Percy's SDK POST
's the DOM snapshot to local Percy server and this was an issue in Cypress in the past (with almost the exact same error message). People are reporting seeing the same issue without Percy and the stack trace doesn't have any Percy code in it.
Looks like we'll have to wait for Cypress to patch
I added a comment to the Cypress issue, but this doesn't appear to be a Percy issue. Staying on v9.0.x will stay away from the issue (I believe) while this is looked at by the Cypress folks. Here's the comment I left on their issue:
I spent some time digging in to try and isolate & reproduce.
describe("Breaking reproduction", function () {
it("doesn't throw an error when making requests", function () {
cy.then(() =>
Cypress.backend("http:request", {
url: "http:localhost:8001/nothing/here",
method: "POST",
})
);
});
});
This will break with the same stack trace in the OP (https://github.com/percy/example-percy-cypress/runs/4400801282?check_suite_focus=true)
Upgrading to v9.1.1 of cypress should solve this https://github.com/cypress-io/cypress/issues/19091
The problem
After adding line to cypress/support/index.js:
then running Cypress fails with:
When I am downgrading cypress to:
There is no error. Everything works properly.
Environment