Fails to POST DOM snapshot to CLI server: `TypeError: Cannot read property 'end' of undefined`
See original GitHub issuePercy snapshot seems to be failing with the following error
CypressError:
cy.then()timed out after waiting
15000ms`.
Your callback function returned a promise that never resolved.
The callback function was:
async () => { if (Cypress.config(‘isInteractive’) && !Cypress.config(‘enablePercyInteractiveMode’)) { return cylog(‘Disabled in interactive mode’, { details: ‘use “cypress run” instead of “cypress open”’, name }); }
// Check if Percy is enabled
if (!await utils.isPercyEnabled()) {
return cylog('Not running', { name });
}
// Inject @percy/dom
if (!window.PercyDOM) {
// eslint-disable-next-line no-eval
eval(await utils.fetchPercyDOM());
}
// Serialize and capture the DOM
return cy.document({ log: false }).then(dom => {
let domSnapshot = window.PercyDOM.serialize({ ...options, dom });
// Post the DOM snapshot to Percy
return utils.postSnapshot({
...options,
environmentInfo: ENV_INFO,
clientInfo: CLIENT_INFO,
domSnapshot,
url: dom.URL,
name
}).then(() => {
// Log the snapshot name on success
cylog(name, { name });
}).catch(error => {
// Handle errors
log.error(`Could not take DOM snapshot "${name}"`);
log.error(error);
});
});
}
Code:
cy.visit('/') cy.url().should('include', '/auth/signup') cy.percySnapshot()
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:26 (10 by maintainers)
Top Results From Across the Web
Trying to serve png in Node.js: Cannot read property 'end' of ...
png) it always crashes with the error message TypeError: Cannot read property 'end' of undefined. This happens no matter what image I use...
Read more >ERROR TypeError: Cannot read property title of undefined
LIKE --- https://codedocu.com/Software/Angular... C# .Net WPF UWP WinUI SQL Server Access Excel vba ++ Freelancer ...
Read more >Cannot read property search of undefined this props location ...
Attempting to read null or undefined as if it was an object. The length property returns a number for essentially any object in...
Read more >jest typeerror: cannot read properties of null (reading 'usestate')
I have used ref in it so as to evoke some bottom sheets in the screen. Error message : TypeError: Cannot read properties...
Read more >Configuring Jest
If the file specified by path is not found, an error is returned. For example, with the following configuration: JavaScript; TypeScript. /** @ ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On different CircleCI tab I see the same error coming from Cypress from all failing tests including that one about
Error: The name of each snapshot must be unique, and this name already exists in the build
On running with
--verbose
I could see the following extra logs apart from the ones posted above(node:13894) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'end' of undefined at IncomingMessage.request.on (*/testFilePath/node_modules/@percy/core/dist/server.js:88:69) at processTicksAndRejections (internal/process/next_tick.js:81:5) (node:13894) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13894) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.