cy.task() must only be invoked from the spec file or support file — regression in 16.0.0/16.1.0
Author: Jack-Booth-DotmaticsCreated Sep 29, 2026Updated Sep 29, 2026
Current behavior
Reference: the prior incarnations — #30933 (v14), #27099 (v12.15)
Reproduction: cy.task() called inside a .then() chain (e.g. cy.wait('@alias').then(() => cy.task('foo'))) — the Bluebird stack trace has no spec-file frames
Desired behavior
Test code to reproduce
Reproduction: cy.task() called inside a .then() chain (e.g. cy.wait('@alias').then(() => cy.task('foo'))) — the Bluebird stack trace has no spec-file frames
Cypress Version
16.0.0 and 16.1.0
Debug Logs
Other
No response
Source: cypress-io/cypress