Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"RangeError: The value of "offset" is out of range." while capturing screenshot #30603

Open
sawsubir opened this issue Nov 12, 2024 · 2 comments
Labels
stage: needs information Not enough info to reproduce the issue topic: screenshots 📸

Comments

@sawsubir
Copy link

sawsubir commented Nov 12, 2024

Current behavior

While capturing screenshot of a screenshot using cy.screenshot(), cypress runs into an exception "RangeError: The value of "offset" is out of range. It must be >= 0 and <= 2974716. Received 2977760". The test is capturing a screenshot of one of the elements with in the DOM. It works fine for other elements where screenshots are being captured but it is throwing an exception here.

Note that the test is running in headless mode on chrome v130.

Here is the stack trace

  _RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 2974716. Received 2977760
      at new NodeError (node:internal/errors:405:5)
      at boundsError (node:internal/buffer:88:9)
      at Buffer.readUInt32BE (node:internal/buffer:311:5)
      at q.<anonymous> (<embedded>:478:177535)
      at e.scan (<embedded>:476:671622)
      at q.scanQuiet (<embedded>:478:69172)
      at q.cropQuiet (<embedded>:478:177475)
      at I.q.<computed> [as crop] (<embedded>:478:65783)
      at A (<embedded>:2793:89146)
      at <unknown> (<embedded>:2793:92977)
      at tryCatcher (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:512:31)
      at Promise._settlePromise (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:569:18)
      at Promise._settlePromise0 (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10)
      at Promise._settlePromises (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18)
      at _drainQueueStep (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/async.js:138:12)
      at _drainQueue (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/async.js:131:9)
      at Async._drainQueues (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/async.js:147:5)
      at Immediate._onImmediate (/users/ukcam/subsaw/.cache/Cypress/13.15.2/Cypress/resources/app/node_modules/bluebird/js/release/async.js:17:14)_

Desired behavior

The screenshot capture should work.

Test code to reproduce

I cannot recreate the exception using a publicly available web application.

Cypress Version

13.15.2

Node version

20.18.0

Operating System

NAME="Red Hat Enterprise Linux" VERSION="8.10 (Ootpa)"

Debug Logs

Refer to https://pastebin.com/AS1EXqrt

Other

No response

@jennifer-shehane
Copy link
Member

@sawsubir We haven't seen this issue in a while. Can you provide a reproducible example?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 12, 2024
@sawsubir
Copy link
Author

I will not be able to share the application code and, unfortunately, I can't recreate it using a sample application. There are many other places where we are capturing screenshots and those work absolutely fine. I don't know what is the issue with this specific one. Is the stacktrace not helping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue topic: screenshots 📸
Projects
None yet
Development

No branches or pull requests

2 participants