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.

Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided.

See original GitHub issue

It seems like the combo of Cypress/Electron doesn’t like:

window.scrollTo({
   behavior: 'smooth',
   top: 0,
})

as I get this error:

Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided.

To get around this, I’m currently doing:

try {
  window.scroll({
    behavior: 'smooth',
    top: 0,
  })
} catch(err) {
  if (err instanceof TypeError) {
    window.scroll(0, 0)
  } else {
    throw err
  }
}

Current behavior:

Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided.

This error originated from your application code, not from Cypress.

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the 'uncaught:exception' event.

https://on.cypress.io/uncaught-exception-from-application

This error originated from your application code, not from Cypress.

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the 'uncaught:exception' event.

https://on.cypress.io/uncaught-exception-from-application
  Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided.
  
  This error originated from your application code, not from Cypress.
  
  When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
  
  This behavior is configurable, and you can choose to turn this off by listening to the 'uncaught:exception' event.

Desired behavior:

Similar behavior to Chrome—work without error.

Steps to reproduce:

Run a headless test on code that has the following:

window.scrollTo({
   behavior: 'smooth',
   top: 0,
})

Versions

"cypress": "^3.1.1",

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jennifer-shehanecommented, Jan 4, 2019

The issue was closed by the original person who opened this. We can reopen until newer version of Electron is released.

1reaction
jennifer-shehanecommented, Jun 10, 2019

Electron was updated to Chrome 61 in Cypress version 3.3.0 and this issue should be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to execute 'scroll' on 'Window': No function was found ...
Chrome only error: Failed to execute 'scroll' on 'Window': No function was found that matched the signature provided · javascript · cross-browser.
Read more >
Failed to execute "scrollTo" on "Window" - GSAP - GreenSock
The ScrollTo plugin has been working perfectly with exactly the same code for the last 4 or 5 months as I developed this...
Read more >
Chrome only error: Failed to execute 'scroll' on 'Window': No ...
Failed to execute 'scroll' on 'Window': No function was found that matched the signature provided. The code is inside an inline event:
Read more >
Window.scrollTo() - Web APIs | MDN
Window.scrollTo() scrolls to a particular set of coordinates in the document.
Read more >
Failed to execute 'scrollTo' on 'Window': No function was found ...
Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided. vue项目在本地使用scrollTo这个方法的时候没有 ...
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