question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

percySnapshot - TypeError: Cannot read properties of undefined (reading 'isTTY')

See original GitHub issue

Current behavior

Running percy exec -- cypress run gives me the following errors:

TypeError: Cannot read properties of undefined (reading 'isTTY')
      at PercyLogger.write (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:5511:27)
      at PercyLogger.log (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:5498:12)
      at Object.isPercyEnabled (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:5839:11)
      at async Context.eval (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:5148:10)

I was able to narrow down where the error/failed tests were stemming from, and it looks like all my tests pass if I comment out lines where I’m using percyScreenshot. The odd thing is that running cypress open works fine and passes all tests as expected.

Desired behavior

No response

Test code to reproduce

The error occurs exactly at line 7, so removing/deleting that line (cy.percySnapshot(...) results in a passing test.

const screenWidths = [375, 768, 1280]

describe("ordering stocks", () => {
  it("should visit homepage", () => {
    cy.visit("/")
    cy.findByText(/My text/)
    cy.percySnapshot("DSC homepage", { widths: screenWidths })
  })
})

Cypress Version

8.7.0

Other

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ayaanquicommented, Nov 3, 2021

@jennifer-shehane Thanks for responding. @alexbjorlig I did post a similar issue on percy/precy-cypress. Here’s the link to the issue if you are interested https://github.com/percy/percy-cypress/issues/430

1reaction
jennifer-shehanecommented, Nov 3, 2021

It seems this error is throwing from the percy plugin, and not Cypress itself. Have you tried opening an issue with Percy? https://github.com/percy/percy-cypress

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'isTTY' of undefined
I have installed twilio latest version in my angular project. But when the project runs, it says that "Cannot read property 'isTTY' of...
Read more >
cannot read properties of undefined (reading 'snapshot')
When I call toMatchImageSnapshot() function, it will give me the below error. TypeError: Cannot read properties of undefined (reading '_counters'). Open side ...
Read more >
percy-cypress - bytemeta
[TypeScript] percySnapshot - TypeError: Cannot read properties of undefined (reading 'isTTY'). Previous Next. Make software development more efficient, ...
Read more >
Issues - percy-cypress - Geeks
Duplicate snapshot name in a parallel build causes missing snapshots · [TypeScript] percySnapshot - TypeError: Cannot read properties of undefined (reading ' ...
Read more >
Percy percy-cypress Issues - Giters
Duplicate snapshot name in a parallel build causes missing snapshots · [TypeScript] percySnapshot - TypeError: Cannot read properties of undefined (reading ' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found